feat: add trusted client IP support for multiple gateways

This commit is contained in:
lingkai5wu committed 2026-09-22 17:08:25 +08:00
1 parent 9ad36c999c
commit 4e17dfc9c9
2 files changed
+35 -9

No files matched your search

+6 -2
View File
@@ -1,13 +1,17 @@
# restrict access
if ($allow_access = 0) {
return 403;
}
# set headers
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-Real-IP $trusted_client_ip;
proxy_set_header X-Forwarded-For $trusted_client_ip;
proxy_set_header X-Forwarded-Proto $scheme;
# clean headers
proxy_set_header X-Origin-Token '';
proxy_set_header EO-Connecting-IP '';
# enable websockets: http://nginx.org/en/docs/http/websocket.html
proxy_http_version 1.1;