小编Ale*_*man的帖子

nginx log full proxy_pass to log

Given the following location with proxy_pass, I want to log the fully qualified uri.

location ~* ^/?(foo/?.*$) {
    proxy_pass https://www.someserver.com/some-thing-else/$1;
    break;
}
Run Code Online (Sandbox Code Playgroud)

So for example I'd like

https://www.originalserver.com/foo?page=5
Run Code Online (Sandbox Code Playgroud)

to redirect to

https://www.someserver.com/some-thing-else/foo?page=5
Run Code Online (Sandbox Code Playgroud)

which I believed to be working; I think something else later down the chain is dropping the query_string.

So I want to output to the log file exactly what it was passed to. I tried $uri, $proxy_host, and $upstream_addr but I couldn't find anything that would return the …

nginx logging

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

logging ×1

nginx ×1