Skip to content

Instantly share code, notes, and snippets.

@shmidtelson
Last active November 17, 2018 10:56
Show Gist options
  • Save shmidtelson/a84f74ca9bd888a3686b5a30570796df to your computer and use it in GitHub Desktop.
Save shmidtelson/a84f74ca9bd888a3686b5a30570796df to your computer and use it in GitHub Desktop.
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment