diff --git a/infra/docker/nginx-production.conf b/infra/docker/nginx-production.conf old mode 100644 new mode 100755 index f03b38263..f9fdef9ae --- a/infra/docker/nginx-production.conf +++ b/infra/docker/nginx-production.conf @@ -13,8 +13,9 @@ server { client_max_body_size 800m; # SPA routing - all routes to index.html + # 注意:不能加 $uri/,否则 /assets 等与构建产物目录同名的路由会被当成目录访问,返回 403 location / { - try_files $uri $uri/ /index.html; + try_files $uri /index.html; } # API proxy diff --git a/infra/docker/nginx-staging.conf b/infra/docker/nginx-staging.conf old mode 100644 new mode 100755 index 56d7502aa..f3735ba18 --- a/infra/docker/nginx-staging.conf +++ b/infra/docker/nginx-staging.conf @@ -13,8 +13,9 @@ server { client_max_body_size 800m; # SPA routing - all routes to index.html + # 注意:不能加 $uri/,否则 /assets 等与构建产物目录同名的路由会被当成目录访问,返回 403 location / { - try_files $uri $uri/ /index.html; + try_files $uri /index.html; } # API proxy diff --git a/infra/docker/nginx.conf b/infra/docker/nginx.conf old mode 100644 new mode 100755 index c1a87006b..601ebaa75 --- a/infra/docker/nginx.conf +++ b/infra/docker/nginx.conf @@ -23,8 +23,9 @@ server { client_max_body_size 800m; # SPA routing - all routes to index.html + # 注意:不能加 $uri/,否则 /assets 等与构建产物目录同名的路由会被当成目录访问,返回 403 location / { - try_files $uri $uri/ /index.html; + try_files $uri /index.html; } # API proxy