Configure auth_basic with Nginx and Passenger

vincentp nginx-forum at nginx.us
Fri Aug 12 08:18:12 UTC 2011


I'm trying to set up a basic authentication with Nginx.

My server configuration look like that:

    server {
      listen 80;
      server_name DOMAIN;
      root /var/www/web-front-dev/current/public;
      error_log /var/log/nginx/web-front-dev-error.log;
      access_log /var/log/nginx/web-front-dev-access.log;
      passenger_enabled on;
      client_max_body_size 100M;
    
      location / {
        passenger_enabled on;
        
        auth_basic "Restricted";
        auth_basic_user_file
/var/www/web-front-dev/shared/simple_authentication_user_file;
      }
    }

The content of simple_authentication_user_file is simply:
a:b


After having restarted everything, I keep having an error while trying
to logging to my domain (I checked that I enter 'b' correctly hmm hmm):

    2011/08/10 16:10:13 [error] 26768#0: *1 user "a": password mismatch,
client: IP, server: DOMAIN, request: "GET / HTTP/1.1", host: "DOMAIN"

I even put a chmod 777 to simple_authentication_user_file to see if it
could be a problem without any success.

Could anyone suggest me something to check?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213723,213723#msg-213723



More information about the nginx mailing list