aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorrock2dust <its@baronbunny.cn>2022-10-18 05:30:30 +0800
committerGitHub <noreply@github.com>2022-10-17 17:30:30 -0400
commitc0888def506f0ca74d3499bb6941a8743f6a5206 (patch)
tree8bbd4221e802757d58fdeadeeec44b4b1f40d2d3 /docs/content
parent6771b1005a693181143a1ca215b0e34f06dcb3f5 (diff)
downloadgitea-c0888def506f0ca74d3499bb6941a8743f6a5206.tar.gz
gitea-c0888def506f0ca74d3499bb6941a8743f6a5206.zip
Update reverse-proxies.zh-cn.md (#21484)
add proxy header to nginx config example ``` proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; ``` Signed-off-by: rock2dust <its@baronbunny.cn> Signed-off-by: rock2dust <its@baronbunny.cn> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/doc/usage/reverse-proxies.zh-cn.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/content/doc/usage/reverse-proxies.zh-cn.md b/docs/content/doc/usage/reverse-proxies.zh-cn.md
index 722b9c7c9d..f6d92e2a61 100644
--- a/docs/content/doc/usage/reverse-proxies.zh-cn.md
+++ b/docs/content/doc/usage/reverse-proxies.zh-cn.md
@@ -13,6 +13,12 @@ menu:
identifier: "reverse-proxies"
---
+# 反向代理
+
+**目录**
+
+{{< toc >}}
+
## 使用 Nginx 作为反向代理服务
如果您想使用 Nginx 作为 Gitea 的反向代理服务,您可以参照以下 `nginx.conf` 配置中 `server` 的 `http` 部分:
@@ -24,6 +30,10 @@ server {
location / {
proxy_pass http://localhost:3000;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
@@ -41,6 +51,10 @@ server {
location /git/ {
# 注意: 反向代理后端 URL 的最后需要有一个路径符号
proxy_pass http://localhost:3000/;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
}
}
```