Files
hldrCenter/management/nginx.conf
2025-11-04 17:45:51 +08:00

24 lines
606 B
Nginx Configuration File
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.
server {
listen 80;
server_name localhost;
# 站点根目录与Dockerfile中复制的目录一致
root /usr/share/nginx/html;
index index.html;
# 解决SPA路由刷新404问题所有请求转发到index.html
location / {
try_files $uri $uri/ /index.html;
}
# 禁止访问隐藏文件(如.gitignore等
location ~ /\. {
deny all;
}
# 静态资源缓存配置(可选,优化性能)
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1d;
add_header Cache-Control "public, max-age=86400";
}
}