From 653f49f095e06e72a571fb0bd689ae0f903806c0 Mon Sep 17 00:00:00 2001 From: chicrobot Date: Thu, 22 Jan 2026 21:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20c1=5Fdocker=E8=BF=90?= =?UTF-8?q?=E8=A1=8Cnginx.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c1_docker运行nginx.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c1_docker运行nginx.md b/c1_docker运行nginx.md index 83857fe..905fa5e 100644 --- a/c1_docker运行nginx.md +++ b/c1_docker运行nginx.md @@ -38,7 +38,7 @@ sudo docker exec nginx nginx -s reload # 重新加载配置 location /uri { alias /path; index index.html; - try_files $uri $uri/ /uri/; + try_files $uri $uri/ /uri/index.html; } ``` 端口代理 @@ -46,4 +46,10 @@ location /uri { location /uri/ { proxy_pass http://127.0.0.1:port/; } +``` +重定向 +``` +location /uri { + return 301 /uri/; +} ``` \ No newline at end of file