September 15, 2010 08:24PM
[quote]I am simply trying to password protect a folder and a file in my webapp with basic_auth, but I'm running into some problems.

Here's the relevant conf info:

location / {
proxy_pass http://127.0.0.1:80xx;
proxy_redirect off;

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_read_timeout 700;
}

location ~ /(admin/.*|test) {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
proxy_pass http://127.0.0.1:9930; # tried both with and without this line
}

I essentially want to protect my admin directory along with the test page, but when I have this location module, I am getting 403 forbidden on my webapp for the admin directory and test page.

Thanks.[/quote]

Sorry, the proxy_pass in both location modules is supposed to be the same port, I was doing some messing around and forgot to change them to be the same.
Subject Author Posted

Basic http auth with proxy pass showing 403/Forbidden

strom September 15, 2010 08:17PM

Re: Basic http auth with proxy pass showing 403/Forbidden

strom September 15, 2010 08:24PM

Re: Basic http auth with proxy pass showing 403/Forbidden

strom September 16, 2010 12:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready