【发布时间】:2021-11-26 20:01:24
【问题描述】:
我有一个这样的设置来反映请求:
location ~ ^/prefix/string/(.*)$
{
proxy_pass https://abc.example.com/$1;
access_log /var/log/nginx/unique.log logformat
}
- 访问我的网站
/prefix/string/more_stuff - 日志显示 404,
$upstream_addr仅包含abc.example.com的 IP, 不是完整的网址 - 日志行显示在
unique.log中,所以我知道我正在点击这个位置块。 - 我想消除带有
$1的URL 构造错误的可能性。 - 我希望能够记录已解决完整的
proxy_passURL,这样我就可以 修复它或继续进行其他类型的调试。
注意:我意识到在这种情况下我可以阅读文档来找出 nginx 的行为。但如果可能的话,只记录解析的 URL 会更快。
问题:对于这样的proxy_pass,如何记录 NGINX 实际访问的解析 URL?
【问题讨论】:
标签: nginx proxy nginx-config