Skip to content

Instantly share code, notes, and snippets.

@tiagomestre
Last active August 3, 2020 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagomestre/492e5c22c98cdd6191ac0f5b163712dc to your computer and use it in GitHub Desktop.
Save tiagomestre/492e5c22c98cdd6191ac0f5b163712dc to your computer and use it in GitHub Desktop.
Nginx for vue and vue-router in production
http {
server {
listen 8080;
server_name //HOST NAME HERE
root /usr/share/nginx/html;
index index.html;
gzip_static on;
include mime.types;
sendfile on;
sendfile_max_chunk 1m;
location /index.html {
etag on;
}
location /health {
access_log off;
return 200;
}
location / {
etag off;
add_header "Cache-Control" "public, max-age=604800, immutable";
try_files $uri /index.html;
}
}
}
events {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment