update nginx conf, try auto apply .html to uri
All checks were successful
Build NGINX on Ubuntu / build-and-deploy (push) Successful in 1m11s

This commit is contained in:
huangzhiqiang 2025-06-10 13:49:18 +08:00
parent 9d66348232
commit 30ae89715c

View File

@ -50,9 +50,13 @@ data:
listen 8080; # 修改为非特权端口
server_name localhost;
# 添加重写规则 - 如果请求不带扩展名且不存在对应目录,尝试添加.html后缀
location / {
root /usr/local/nginx/html;
index index.html index.htm;
# 首先尝试完全匹配,然后尝试添加.html扩展名最后回退到index
try_files $uri $uri.html $uri/ /index.html;
}
# 健康检查端点