Skip to content

Commit aa60cd9

Browse files
eeyrjmrlunny
andauthored
Update nginx reverse proxy docs (#18922)
Add additional config lines for the set_header to forward additional information (eg the IP) Co-authored-by: Lunny Xiao <[email protected]>
1 parent bf2867d commit aa60cd9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/content/doc/usage/reverse-proxies.en-us.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ server {
3030
3131
location / {
3232
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;
3337
}
3438
}
3539
```
@@ -47,6 +51,10 @@ server {
4751
location /git/ {
4852
# Note: Trailing slash
4953
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;
5058
}
5159
}
5260
```

0 commit comments

Comments
 (0)