Created
January 28, 2019 11:41
-
-
Save jmercouris/73776f7b0983bc458814286d04838308 to your computer and use it in GitHub Desktop.
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
| ######################################################################## | |
| # CURRENT CONFIGURATION | |
| ######################################################################## | |
| server { | |
| listen 80; | |
| server_name www.example.com example.com; | |
| return 301 https://$host$request_uri; | |
| location /static/ { | |
| alias /root/directory/static/; | |
| autoindex on; | |
| } | |
| location / { | |
| proxy_pass http://127.0.0.1:5000; | |
| } | |
| } | |
| ######################################################################## | |
| # NEW CONFIGURATION | |
| ######################################################################## | |
| server { | |
| listen 80; | |
| server_name www.example.com example.com; | |
| return 301 https://$host$request_uri; | |
| location / { | |
| try_files $uri $uri/ @backend; | |
| } | |
| location @backend { | |
| proxy_pass http://127.0.0.1:5000; | |
| } | |
| } | |
| ######################################################################## | |
| # Contents of static folder | |
| ######################################################################## | |
| /static | |
| /static/images | |
| /static/js | |
| /static/css | |
| ... etc | |
| ######################################################################## | |
| # How they are referenced in HTML | |
| ######################################################################## | |
| <img src="images/file.png"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment