0

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

www-authenticate 失败 Postman 结果 nginx www-authentication

这里它适用于另一个使用基本身份验证的请求 Postman 结果 nginx 基本类型认证

这是我的 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

4

1 回答 1

0

这是因为我在 CLIENT_SECRET_KEY 前有“标题中的下划线”

要解决这个问题,您需要添加已underscores_in_headers on;解决的 nginx.conf 问题。

于 2020-05-03T15:27:12.473 回答