Nginx: help on how to make working double basic auth (basic auth over basic auth)?

Viewed 24

I have an nginx-proxy and an app with basic auth behind (i can't change auth type for it). When i'm setting basic auth in nginx, it not accepting credentials. For other hosts without basic auth (i mean that there is only 1 basic auth, in nginx only) it is working correctly. How it can be solved?

    server {
    server_name ***;
    client_max_body_size 32M;
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
    location / {
        proxy_pass https://upstream-1;
        proxy_set_header Authorization "";
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto "https";
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
    }
0 Answers
Related