【问题标题】:nginx reverse proxy issue with www-authenticatewww-authenticate 的 nginx 反向代理问题
【发布时间】:2020-03-06 10:54:23
【问题描述】:

我想使用 nginx 反向代理将传入的 http 请求路由到本地端口 8081,但在 8081 上运行的应用程序需要 www-authenticate 标头授权,邮递员给我状态 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

【问题讨论】:

    标签: nginx centos7 nginx-reverse-proxy openresty www-authenticate


    【解决方案1】:

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

    要解决这个问题,您需要在 nginx.conf 中添加 underscores_in_headers on; 问题解决了。

    【讨论】:

      猜你喜欢
      • 2020-05-20
      • 2016-02-12
      • 1970-01-01
      • 2014-10-27
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多