# nginx vue 处理前台路由 history 模式刷新 404 的问题 location / { try_files $uri $uri/ /index.html; if ($uri ~* .*\.(?:htm|html)$) { add_header Cache-Control "no-store, no-cache"; add_header Pragma "no-cache"; } if ($uri ~* .*\.(?:js|css|jpg|jpeg|gif|png|ico|cur|gz|ttf|woff|ico|svg|svgz|mp4|ogg|ogv|webm)$) { expires 7d; access_log off; add_header Cache-Control "public"; } index index.html index.htm; }