Auth user with postgresql

Piotr Sikora piotr.sikora at
Fri Feb 17 12:49:28 UTC 2012


> Nginx does not ask user and password with the following configuration:

That's because you're returning 403 (Forbidden) instead of 401 

I should update README file, because people get confused by this ;)

> postgres_rewrite  no_rows 403;

-postgres_rewrite  no_rows 403;
+postgres_rewrite  no_rows 401;
+more_set_headers -s 401 'WWW-Authenticate: Basic realm="Restricted"';

You'll also need ngx_headers_more module for this to work:

Best regards,
Piotr Sikora < piotr.sikora at >

More information about the nginx mailing list