Nginx:将实际转发的代理传递请求URI记录到上游

Nginx:将实际转发的代理传递请求URI记录到上游,nginx,server,nginx-reverse-proxy,proxypass,server-configuration,Nginx,Server,Nginx Reverse Proxy,Proxypass,Server Configuration,我有以下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

我有以下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
而我的预期产出是:

[proxied request] localhost/test/bar/foo -> 127.0.0.1:3000 
[proxied request] localhost/test/bar/foo -> 127.0.0.1:3000/bar

有没有一个变量或方法可以在日志中生成实际的代理URI?

darn我也需要它@roeb那么你可以把这个问题投上去#名誉寻求者:)该死的,我也需要这个@roeb那么你可以投票支持这个问题#声誉寻求者:)