改变 proxy_pass, 如果执行条件?
我想大多数时间使用向上的流,但另一个我想允许基于请求标头的目标服务器指示 X-Target-Server.
我有一个正在寻找请求变量的服务器,并将其显示为我的一部分 nginx.conf. 然后我有一个虚拟服务器的配置,执行以下操作:
指令指令时会发生什么 proxy_pass? 马上跑? 它让他工作了两次吗? 或者它将仅在第二次执行情况时瞄准?
似乎它在一些位置块工作,但在别人身上不起作用,我不明白为什么。 是否有更好的方法来接近这个? 以下完整位置
它似乎有效
似乎没有工作
我有一个正在寻找请求变量的服务器,并将其显示为我的一部分 nginx.conf. 然后我有一个虚拟服务器的配置,执行以下操作:
proxy_pass [url=https://backend_dev_test;]https://backend_dev_test;[/url]
if ($is_target_specified) {
proxy_pass https://$http_x_target_server;
}
指令指令时会发生什么 proxy_pass? 马上跑? 它让他工作了两次吗? 或者它将仅在第二次执行情况时瞄准?
似乎它在一些位置块工作,但在别人身上不起作用,我不明白为什么。 是否有更好的方法来接近这个? 以下完整位置
它似乎有效
location ~* /v3/(test|other)/ {
proxy_cache_bypass "1";
proxy_no_cache "1";
resolver 8.8.8.8;
proxy_ignore_client_abort on;
rewrite ^/v3/(.*)$ /$1 break;
proxy_pass [url=https://backend_dev_test;]https://backend_dev_test;[/url]
if ($is_target_specified) {
proxy_pass https://$http_x_target_server;
}
}
似乎没有工作
location ~* /v3 {
proxy_cache_bypass "1";
proxy_no_cache "1";
resolver 8.8.8.8;
proxy_ignore_client_abort on;
proxy_pass [url=https://backend_dev;]https://backend_dev;[/url]
if ($is_target_specified) {
proxy_pass https://$http_x_target_server;
}
}
没有找到相关结果
已邀请:
0 个回复