ngx_http_proxy_connect_module
ngx_http_proxy_connect_module copied to clipboard
$upstream_addr not set
0. Before Your ASK
- Try to find an answer by reading a FAQ.
Ⅰ. Issue Description
log_format main '$proxy_protocol_addr $bytes_sent $request_length [$time_local] "$request" "$upstream_addr"' '$status "$http_referer" "$http_user_agent"' ;
Ⅱ. Describe what happened
In log file, Upstream_addr expected to be real upstream ip address
Ⅲ. Describe what you expected to happen
In log file, Upstream_addr was set as -.
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅴ. Anything else we need to know?
- If applicable, add nginx debug log.
Ⅵ. Environment:
- Tengine/Nginx/OpenResty version (use
sbin/nginx -v): - Which patch do you use?
Maybe it failed before running 'connecting upstream' phase, you can post the whole log message here to let us check.
I used $connect_addr instead, but I think $upstream_addr should be reused in connect module too
http {
log_format main '$proxy_protocol_addr $bytes_sent $request_length [$time_local] "$request" "$connect_addr"'
'$status "$http_referer" "$http_user_agent"' ;
server{
}
BTW, I wish to log proxy_connect_bind, as I have multi wan, I want to log every outing connections and bind_address I tried $proxy_connect_bind, but I got
nginx: [emerg] unknown "proxy_connect_bind" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
Any ideas?