-
-
Save mariusbutuc/ac3a1a77111771c66482c501ccdffaeb to your computer and use it in GitHub Desktop.
Nginx and React URL routing
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
server { | |
listen 80; | |
server_name localhost; | |
root /usr/share/nginx/html; | |
location / { | |
expires 5m; | |
try_files $uri $uri/ /index.html; | |
} | |
location ~* \.html$ { | |
expires 5m; | |
} | |
location ~* "\.\w{2,4}$" { | |
expires 1y; | |
try_files $uri =404; | |
} | |
error_page 500 502 503 504 /50x.html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment