我想使用nginx反向代理将传入的http请求路由到本地端口8081,但是在8081上运行的应用程序需要www-authenticate标头授权,邮递员给我状态401“身份验证失败”(图像1)。但是,当我使用Apache httpd进行反向代理时,我会成功获得结果。
这是我的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,请在此问题上帮助我
underscores_in_headers on;
问题已解决。