File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 13
13
identifier : " reverse-proxies"
14
14
---
15
15
16
+ # 反向代理
17
+
18
+ ** 目录**
19
+
20
+ {{< toc >}}
21
+
16
22
## 使用 Nginx 作为反向代理服务
17
23
18
24
如果您想使用 Nginx 作为 Gitea 的反向代理服务,您可以参照以下 ` nginx.conf ` 配置中 ` server ` 的 ` http ` 部分:
@@ -24,6 +30,10 @@ server {
24
30
25
31
location / {
26
32
proxy_pass http://localhost:3000;
33
+ proxy_set_header Host $host;
34
+ proxy_set_header X-Real-IP $remote_addr;
35
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
36
+ proxy_set_header X-Forwarded-Proto $scheme;
27
37
}
28
38
}
29
39
```
@@ -41,6 +51,10 @@ server {
41
51
location /git/ {
42
52
# 注意: 反向代理后端 URL 的最后需要有一个路径符号
43
53
proxy_pass http://localhost:3000/;
54
+ proxy_set_header Host $host;
55
+ proxy_set_header X-Real-IP $remote_addr;
56
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
57
+ proxy_set_header X-Forwarded-Proto $scheme;
44
58
}
45
59
}
46
60
```
You can’t perform that action at this time.
0 commit comments