ngx_http_proxy_connect_module icon indicating copy to clipboard operation
ngx_http_proxy_connect_module copied to clipboard

$upstream_addr not set

Open bigboyq opened this issue 3 years ago • 3 comments

0. Before Your ASK

  1. 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?

  1. If applicable, add nginx debug log.

Ⅵ. Environment:

  1. Tengine/Nginx/OpenResty version (use sbin/nginx -v):
  2. Which patch do you use?

bigboyq avatar Mar 07 '22 03:03 bigboyq

Maybe it failed before running 'connecting upstream' phase, you can post the whole log message here to let us check.

chobits avatar Mar 26 '22 09:03 chobits

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{
}

bigboyq avatar Mar 27 '22 10:03 bigboyq

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?

bigboyq avatar Mar 27 '22 10:03 bigboyq