0
我对特定的nginx设置有问题。场景如下所示:应用程序需要通过nginx代理访问couchdb服务。 nginx需要设置授权头才能访问后端。问题在于后端服务端点的DNS更改有时会导致我的服务停止工作,直到重新加载nginx。动态nginx上游不能与授权标头一起工作
我试图将上游设置为一个变量,但是当我这样做时,授权停止工作,后端返回403.当我使用上游指令时,它工作得很好。上游变量具有正确的值,日志中没有错误。
的配置如下片段:
set $backend url.to.backend;
location/{
proxy_pass https://$backend/api;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host url.to.backend;
proxy_set_header Authorization "Basic <authorization_gibberish>";
proxy_temp_path /mnt/nginx_proxy;
}
任何帮助将不胜感激。