【发布时间】:2020-09-01 21:27:18
【问题描述】:
我有以下 nginx 配置文件:
http {
log_format upstream_logging '[proxied request] '
'$server_name$request_uri -> $upstream_addr';
access_log /dev/stdout upstream_logging;
server {
listen 80;
server_name localhost;
location ~ /test/(.*)/foo {
proxy_pass http://127.0.0.1:3000/$1;
}
}
}
当我击中时:
http://localhost/test/bar/foo
我的实际输出是:
[proxied request] localhost/test/bar/foo -> 127.0.0.1:3000
虽然我的预期输出是:
[proxied request] localhost/test/bar/foo -> 127.0.0.1:3000/bar
是否有变量或方法可以在日志中生成实际的代理 URI?
【问题讨论】:
-
我也需要那个!
-
@roeb 那么你可以投票支持#reputationSeeker :)
标签: nginx server nginx-reverse-proxy proxypass server-configuration