Last active
May 17, 2021 09:47
-
-
Save thinhbuzz/09a6ca24b1e96ab76c4c5128d400aa06 to your computer and use it in GitHub Desktop.
nginx config for react application
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
gzip on; | |
gzip_disable "msie6"; | |
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /usr/share/nginx/html; | |
index index.html; | |
location ~ ^/(css|js)/ { | |
# These assets include a digest in the filename, so they will never change | |
expires max; | |
} | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment