Skip to content

Instantly share code, notes, and snippets.

@thinhbuzz
Last active May 17, 2021 09:47
Show Gist options
  • Save thinhbuzz/09a6ca24b1e96ab76c4c5128d400aa06 to your computer and use it in GitHub Desktop.
Save thinhbuzz/09a6ca24b1e96ab76c4c5128d400aa06 to your computer and use it in GitHub Desktop.
nginx config for react application
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