Nginx反向代理基本身份验证Base64网址编码

时间:2019-10-22 14:33:53

标签: nginx base64 reverse-proxy

我在Web应用程序前面使用了反向代理,但我没有没有帮助。

要自动连接用户,我使用基本身份验证。因此,我在网址的base 64中传递了一个参数,像这样http://mysiteweb/monurl?User=credentialsBase64Encoded

不幸的是,URL代理后面的Web应用程序对我的查询字符串参数进行了编码。因此,当我的代理在标头中传递身份验证时,身份验证就不好了。

这是我的Nginx配置。

server {
    listen    80;
    root /usr/share/nginx/www;
    index index.html index.htm;
    server_name mydomain.com;

    location /mywebapp/ {

        set $basicAuth "Basic $arg_user";
        proxy_pass http://localhost:3524/;
        proxy_set_header Authorization $basicAuth;
    }
}

如何在不访问代理后面的Web应用程序的情况下解决问题?

预先感谢您的回答。

0 个答案:

没有答案
相关问题