ngx_http_proxy_connect_module
ngx_http_proxy_connect_module copied to clipboard
https and "X-Forwarded-For"?
Hello, tell me how to send "X-Forwarded-For" using an https proxy? When I go to http, X-Forwarded-For is transmitted correctly, and when I use https it disappears.
` server { listen 8443; # dns resolver used by forward proxying resolver 1.1.1.1;
# forward proxy for CONNECT request
proxy_connect;
proxy_connect_allow 443 563;
proxy_connect_connect_timeout 10s;
proxy_connect_read_timeout 10s;
proxy_connect_send_timeout 10s;
#set $ngx.var.http_x-forwarded-for $proxy_add_x_forwarded_for;
location / {
proxy_pass http://$host;
proxy_set_header Host $host;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
}
} `
When I go to http, X-Forwarded-For is transmitted correctly, and when I use https it disappears.
For https, the raw data is proxied by this module directly, and it is SSL encrpted data. So we cannot insert 'X-forwarded-For' header ( or any other data) into the proxied data flow.
For http, this module does not work, it's proxied by nginx original http proxy module.
think it resolved, if you still have any problem, feel free to reopen or file a new issue