Fixes in flask
This commit is contained in:
parent
c4f97f5139
commit
e286c8fd2c
2 changed files with 11 additions and 9 deletions
|
|
@ -88,7 +88,7 @@ if($linux_distro=='rocky' || $linux_distro=='almalinux' || $linux_distro=='fedor
|
||||||
|
|
||||||
if($linux_distro=='ubuntu' || $linux_distro=='debian') {
|
if($linux_distro=='ubuntu' || $linux_distro=='debian') {
|
||||||
|
|
||||||
$activate_modules=['debian' => ["sudo a2enmod ssl rewrite proxy proxy_fcgi"]];
|
$activate_modules=['debian' => ["sudo a2enmod ssl rewrite proxy proxy_fcgi headers"]];
|
||||||
|
|
||||||
$activate_modules['ubuntu']=$create_vhost_file['debian'];
|
$activate_modules['ubuntu']=$create_vhost_file['debian'];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,8 @@ if args.path:
|
||||||
|
|
||||||
path=args.path[:-1]
|
path=args.path[:-1]
|
||||||
|
|
||||||
|
full_path=args.path
|
||||||
|
|
||||||
if path=='':
|
if path=='':
|
||||||
path='/'
|
path='/'
|
||||||
|
|
||||||
|
|
@ -154,19 +156,19 @@ name_file='/home/{}/{}'.format(system_user, base_name_file)
|
||||||
|
|
||||||
with open(name_file, 'w') as f:
|
with open(name_file, 'w') as f:
|
||||||
|
|
||||||
f.write("ProxyPreserveHost On")
|
f.write("ProxyPreserveHost On\n")
|
||||||
f.write("ProxyRequests Off")
|
f.write("ProxyRequests Off\n")
|
||||||
|
|
||||||
f.write("<Location %s>\n" % path[:1])
|
f.write("<Location %s>\n" % path)
|
||||||
#ProxyPass unix:/home/root/flask_rest/flaskrest.sock|http://127.0.0.1/
|
#ProxyPass unix:/home/root/flask_rest/flaskrest.sock|http://127.0.0.1/
|
||||||
f.write("ProxyPass unix:%sgunicorn.sock|http://127.0.0.1%s\n" % (home_user, path))
|
f.write("ProxyPass unix:%sgunicorn.sock|http://127.0.0.1%s\n" % (home_user, full_path))
|
||||||
f.write("ProxyPassReverse unix:%sgunicorn.sock|http://127.0.0.1%s\n" % (home_user, path))
|
f.write("ProxyPassReverse unix:%sgunicorn.sock|http://127.0.0.1%s\n" % (home_user, full_path))
|
||||||
|
|
||||||
if path!='/':
|
if path!='/':
|
||||||
f.write("RequestHeader set SCRIPT_NAME %s" % path[:1])
|
f.write("RequestHeader set SCRIPT_NAME %s\n" % path)
|
||||||
|
|
||||||
f.write("RequestHeader set X-Forwarded-Proto http")
|
f.write("RequestHeader set X-Forwarded-Proto http\n")
|
||||||
f.write("RequestHeader set X-Forwarded-Prefix %s" % path[:1])
|
f.write("RequestHeader set X-Forwarded-Prefix %s\n" % path)
|
||||||
|
|
||||||
f.write("</Location>\n")
|
f.write("</Location>\n")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue