From 7a56e9477791cb9f92ca2591fc9ca76b204adb01 Mon Sep 17 00:00:00 2001 From: haml-707 <845831435@qq.com> Date: Thu, 9 May 2024 15:04:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20nginx=20=E8=B5=84=E6=BA=90=20try=5Ffiles?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/nginx/nginx.conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 2113256..69670a4 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -101,6 +101,13 @@ http { return 404; } + location = / { + rewrite ^/$ /zh/issues/ redirect; + } + location = /zh/ { + rewrite ^/zh/$ /zh/issues/ redirect; + } + location / { limit_req zone=ratelimit burst=5 nodelay; proxy_set_header X-Forwarded-For $http_x_real_ip; @@ -115,6 +122,10 @@ http { add_header Cache-Control "public,max-age=1209600"; } + location / { + try_files $uri $uri/ /index.html; + } + root /usr/share/nginx/www; index index.html; } @@ -139,10 +150,6 @@ http { } - location ~ ^/(quick-issue) { - try_files $uri /index.html; - } - error_page 401 402 403 405 406 407 413 414 /error.html; error_page 404 /404.html; error_page 500 501 502 503 504 505 /error.html; -- Gitee