Last active
January 26, 2021 14:35
-
-
Save nedludd0/bc806e44dfc940cd4db53704d9f61322 to your computer and use it in GitHub Desktop.
nginx-reverse-proxy-flask-app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### FLASK PROD wsgi python code | |
| location /url_sub_path { | |
| #forward application requests to the wsgi server | |
| proxy_pass http://unix:/var/www/python/flask/flask.sock; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| } | |
| #### FLASK PROD wsgi python static files | |
| location /url_sub_path/static { | |
| ## handle static files directly, without forwarding to the application | |
| alias /var/www/python/flask_app/static; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment