Fixes in flask site
This commit is contained in:
parent
4dd7e4531f
commit
c4f97f5139
1 changed files with 16 additions and 6 deletions
|
|
@ -154,17 +154,27 @@ name_file='/home/{}/{}'.format(system_user, base_name_file)
|
||||||
|
|
||||||
with open(name_file, 'w') as f:
|
with open(name_file, 'w') as f:
|
||||||
|
|
||||||
if path=='/':
|
f.write("ProxyPreserveHost On")
|
||||||
f.write("<Location %s.well-known/acme-challenge/>\n" % path)
|
f.write("ProxyRequests Off")
|
||||||
f.write("ProxyPass !\n")
|
|
||||||
f.write("</Location>\n")
|
|
||||||
|
|
||||||
f.write("<Location %s>\n" % path)
|
f.write("<Location %s>\n" % path[:1])
|
||||||
#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, 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, path))
|
||||||
|
|
||||||
|
if path!='/':
|
||||||
|
f.write("RequestHeader set SCRIPT_NAME %s" % path[:1])
|
||||||
|
|
||||||
|
f.write("RequestHeader set X-Forwarded-Proto http")
|
||||||
|
f.write("RequestHeader set X-Forwarded-Prefix %s" % path[:1])
|
||||||
|
|
||||||
f.write("</Location>\n")
|
f.write("</Location>\n")
|
||||||
|
|
||||||
|
if path=='/':
|
||||||
|
f.write("<Location /.well-known/acme-challenge/>\n")
|
||||||
|
f.write("ProxyPass !\n")
|
||||||
|
f.write("</Location>\n")
|
||||||
|
|
||||||
|
|
||||||
print('Updating apache configuration for wordpress outside of htdocs...')
|
print('Updating apache configuration for wordpress outside of htdocs...')
|
||||||
if subprocess.call('sudo mv {} /etc/{}/vhosts.d/extra && sudo chown root:root /etc/{}/vhosts.d/extra/{}'.format(name_file, apache_cmd, apache_cmd, base_name_file), shell=True) > 0:
|
if subprocess.call('sudo mv {} /etc/{}/vhosts.d/extra && sudo chown root:root /etc/{}/vhosts.d/extra/{}'.format(name_file, apache_cmd, apache_cmd, base_name_file), shell=True) > 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue