我想使用nginx反向代理将传入的http请求路由到本地端口8081,但在8081上运行的应用程序需要www-authenticate标头授权,postman给我状态401“验证失败”(图1)。但是,当我使用Apache httpd执行反向代理时,我成功地获得了结果。
www-authenticate失败

在这里,它为另一个使用基本身份验证的请求工作

这是我的nginx.conf
location /webfolder/ {
proxy_pass http://localhost:8081;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;请帮助我解决这个问题,因为我不熟悉nginx,nginx版本1.16
发布于 2020-05-03 23:27:12
这是因为我在标题中有“下划线”,例如CLIENT_SECRET_KEY
为了解决这个问题,你需要在你解决的nginx.conf中添加underscores_in_headers on;。
https://stackoverflow.com/questions/60562600
复制相似问题