Fixes in flask site
This commit is contained in:
parent
4dd7e4531f
commit
c4f97f5139
1 changed files with 16 additions and 6 deletions
|
|
@ -154,15 +154,25 @@ name_file='/home/{}/{}'.format(system_user, base_name_file)
|
|||
|
||||
with open(name_file, 'w') as f:
|
||||
|
||||
if path=='/':
|
||||
f.write("<Location %s.well-known/acme-challenge/>\n" % path)
|
||||
f.write("ProxyPass !\n")
|
||||
f.write("</Location>\n")
|
||||
f.write("ProxyPreserveHost On")
|
||||
f.write("ProxyRequests Off")
|
||||
|
||||
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/
|
||||
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))
|
||||
|
||||
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")
|
||||
|
||||
if path=='/':
|
||||
f.write("<Location /.well-known/acme-challenge/>\n")
|
||||
f.write("ProxyPass !\n")
|
||||
f.write("</Location>\n")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue