Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream_addr 字段 打印多个端口的问题。 #1921

Open
zhouying370481 opened this issue Mar 14, 2024 · 0 comments
Open

upstream_addr 字段 打印多个端口的问题。 #1921

zhouying370481 opened this issue Mar 14, 2024 · 0 comments
Assignees

Comments

@zhouying370481
Copy link

Tengine version: Tengine/2.0.2 (nginx/1.4.6)
server_name xxxx.com {
location /qweixin/ {
proxy_pass http://rssp-act_core_rs_com/;
include proxy.conf;
}
upstream rssp-act_core_rs_com {
server 172.18.48.23:9097;
server 172.18.48.24:9097;
}
}
当我访问xxxx.com/qweixin 的时候,nginx 访问日志:upstream_addr 连续2个端口,
upstream_addr":"172.18.48.23:9097:9097。
完整日志如下:
{"@timestamp":"2024-03-12T11:18:53+08:00","server_addr":"172.16.76.220","server_port":"80","http_COOKIE":"-","ssl_protocol":"-","remote_addr":"58.255.172.138","http_x_forwarded_for":"223.104.76.56","remote_user": "-","time_local": "12/Mar/2024:11:18:53 +0800","request": "GET /qweixin/qwx/common/js/jquery/jquery-1.10.1.min.js HTTP/1.1","host": "static3.xxxx.com","uri":"/qweixin/qwx/common/js/jquery/jquery-1.10.1.min.js","status":"502","body_bytes_sent":"668","request_time":"0.002","upstream_response_time":"0.002, 0.000","upstream_addr":"172.18.48.23:9097:9097","http_referer":"http://weixin.xxxx.com/","http_user_agent":"Mozilla/5.0 (Linux; Android 12; JEF-AN00 Build/HUAWEIJEF-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 XWEB/1160065 MMWEBSDK/20231202 MMWEBID/5362 MicroMessxxnger/8.0.47.2560(0x28002F3B) WeChat/arm64 Weixin NetType/5G Language/zh_CN ABI/arm64"}.

tengine 日志格式:
log_format ngx_json '{"@timestamp":"$time_iso8601",'
'"server_addr":"$server_addr",'
'"server_port":"$server_port",'
'"http_COOKIE":"$http_COOKIE",'
'"ssl_protocol":"$ssl_protocol",'
'"remote_addr":"$remote_addr",'
'"http_x_forwarded_for":"$http_x_forwarded_for",'
'"remote_user": "$remote_user",'
'"time_local": "$time_local",'
'"request": "$request",'
'"host": "$host",'
'"uri":"$uri",'
'"status":"$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"upstream_response_time":"$upstream_response_time",'
'"upstream_addr":"$upstream_addr",'
'"http_referer":"$http_referer",'
'"http_user_agent":"$http_user_agent"}';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants