Welcome! Log In Create A New Profile

Advanced

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

Brane F. Gračnar
August 31, 2011 06:48AM
On Wednesday 31 of August 2011 12:07:27 ssaravalli wrote:
> Hello to everybody, my name is Simone Saravalli and I'm new to NGINX
> world.
>
> This is my problem: I set up NGINX as a reverse proxy to a backend
> server with Apache. On NGINX side I configured basic authentication for
> / location:
>
> location / {
> auth_basic "Restricted";
> auth_basic_user_file /etc/nginx/htpasswd;
> proxy_pass http://xxx.xxx.xxx.xxx;
> proxy_redirect off;
> proxy_set_header Authorization "";
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For
> $proxy_add_x_forwarded_for;
> proxy_set_header X-Forwarded-Ssl on;
> }

You're removing Authorization request header before sending request to Apache
server. That's why Apache cannot authenticate user.

Comment-out the following line and try again:

proxy_set_header Authorization "";

Best regards, Brane

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

ssaravalli August 31, 2011 06:07AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

Brane F. Gračnar August 31, 2011 06:48AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

ssaravalli August 31, 2011 07:15AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

Igor Sysoev August 31, 2011 08:28AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

ssaravalli September 01, 2011 10:19AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

Maxim Dounin September 01, 2011 10:52AM

Re: Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

ssaravalli September 02, 2011 02:09AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready