Created
July 6, 2018 03:17
-
-
Save vesper8/ec6c079f810afeb19004937b2a153dcc to your computer and use it in GitHub Desktop.
NGiNX Configuration for Vue-Router in HTML5 Mode
This file contains 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 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 ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | |
# Some basic cache-control for static files to be sent to the browser | |
expires max; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
} |
Really helpful, thanks a lot!
It works, thank you! :)
Thanks!!!! Exactly what I'm searching for.
Imade somethins similar for finished build of Vue app here
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!!