Forum: NGINX Problem with auth_basic and auth_basic_user_file

2974d09ac2541e892966b762aad84943?d=identicon&s=25 Varix (Guest)
on 2014-06-23 21:26
(Received via mailing list)
Hallo,

I want a login for this location.

    location /TEST/ {
       alias /www/c2c/;
       }

With

  location /TEST/ {
       alias /www/c2c/;
       auth_basic "Test Auth";
      }

no username/password box in the browser. I see the index.html site from
the
c2c folder


With

    location /TEST/ {
       alias /www/c2c/;
       auth_basic "Test Auth";
       auth_basic_user_file /nginx/conf/htpasswd;
       }

and an "404 Not Found" error shows the browser.

I use  nginx 1.7.2

Where is the problem?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251118,251118#msg-251118
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-06-24 04:36
(Received via mailing list)
Hello!

On Mon, Jun 23, 2014 at 03:26:14PM -0400, Varix wrote:

>   location /TEST/ {
>        alias /www/c2c/;
>        auth_basic "Test Auth";
>       }
>
> no username/password box in the browser. I see the index.html site from the
> c2c folder

This is expected.  Both auth_basic and auth_basic_user_file must
be set for auth_basic to work.

> With
>
>     location /TEST/ {
>        alias /www/c2c/;
>        auth_basic "Test Auth";
>        auth_basic_user_file /nginx/conf/htpasswd;
>        }
>
> and an "404 Not Found" error shows the browser.

This likely indicate you have some error_page's configured, and
they intercept "401 Unauthorized" returned.  Try looking into your
configs and into error log.

--
Maxim Dounin
http://nginx.org/
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Varix (Guest)
on 2014-06-24 17:59
(Received via mailing list)
Hallo Maxim,

thanks. I copy some errorpages in the custom errorpage folder and all is
OK.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251118,251134#msg-251134
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.