feat: support to define trusted addresses for proxy protocol in stream block

This commit is contained in:
agile6v 2020-08-27 21:40:10 +08:00
parent 96d190d708
commit 609e1b5775
2 changed files with 72 additions and 0 deletions

View file

@ -705,6 +705,12 @@ stream {
error_log {{ $cfg.ErrorLogPath }};
{{ if $cfg.EnableRealIp }}
{{ range $trusted_ip := $cfg.ProxyRealIPCIDR }}
set_real_ip_from {{ $trusted_ip }};
{{ end }}
{{ end }}
upstream upstream_balancer {
server 0.0.0.1:1234; # placeholder