Files
web/nginx/web.conf

19 lines
517 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 供 compose 中 web 容器使用:宿主机挂载 web/dist 与 verify-root仅提供静态与 SPA 回退
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location ~ ^/([A-Za-z0-9._-]+\.(txt|html|xml))$ {
alias /verify-root/$1;
}
location = / {
try_files /index.html =404;
}
# 前台为 Vue SPA任意路径须回退到 index.html否则直接访问 /xxx 会得到 nginx 404
location / {
try_files $uri $uri/ /index.html;
}
}