Last active
December 1, 2017 05:55
-
-
Save avesus/68a2654a51d4214a0b0ddb47cf8c4d21 to your computer and use it in GitHub Desktop.
Nginx perfect nodern SPA config
This file contains 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
location /app/ { | |
expires max; | |
} | |
location /img/ { | |
expires max; | |
} | |
location = /favicon.ico { | |
try_files $uri =204; | |
} | |
location /api/ { | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_pass http://nodejs; | |
proxy_set_header Host $host; | |
proxy_set_header Upgrade $http_upgrade; # allow websockets | |
proxy_set_header Connection $connection_upgrade; | |
} | |
location / { | |
try_files '' /index.html last; | |
add_header Cache-Control "private, max-age=0, no-cache, no-store, must-revalidate"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment