Welcome! Log In Create A New Profile

Advanced

Auth user with postgresql

Giuseppe Tofoni
February 17, 2012 07:40AM
Hi list
I am a nginx newbie.
Nginx does not ask user and password with the following configuration:
........
upstream database
{
postgres_server 127.0.0.1 dbname=dbnginx user=nginx password=secret;
}

server
{
listen 80;
server_name localhost;
index index.htm index.html;

location =/t1
{
internal;

postgres_escape $user $remote_user;
postgres_escape $pass $remote_passwd;

postgres_pass database;
postgres_query "SELECT user FROM usertable WHERE
user=$user AND pwd=$pass";
postgres_rewrite no_rows 403;
postgres_output none;
}

location /test //don't request window for user and password
{
auth_basic "folder test1";
auth_request /t1;
}

location /test2 //o.k. request window for user and password
{
auth_basic "folder Test2";
auth_basic_user_file /web/test2/.passwd;
}
-----------
I did several searches on google but found nothing.
Where is the mistake?
Thanks for the help

Giuseppe

P.S: the database connection is ok and password is stored in MD5
follow my compilation config

../configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/local/nginx/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--http-uwsgi-temp-path=/var/tmp/nginx \
--http-scgi-temp-path=/var/tmp/nginx \
--user=nobody \
--group=nobody \
--with-ipv6 \
--with-http_dav_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--add-module=/home/mercurio/nginx/ngx_http_auth_request_module-a29d74804ff1 \
--add-module=/home/mercurio/nginx/FRiCKLE-ngx_coolkit-cb99a0f \
--add-module=/home/mercurio/nginx/agentzh-nginx-eval-module-09d7728 \
--add-module=/home/mercurio/nginx/ngx_postgres-0.9

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

Auth user with postgresql

Giuseppe Tofoni February 17, 2012 07:40AM

Re: Auth user with postgresql

Piotr Sikora February 17, 2012 07:50AM

Re: Auth user with postgresql

Francis Daly February 17, 2012 07:56AM

Re: Auth user with postgresql

Giuseppe Tofoni February 17, 2012 02:14PM

Re: Auth user with postgresql

Piotr Sikora February 17, 2012 02:28PM

Re: Auth user with postgresql

Giuseppe Tofoni February 17, 2012 03:26PM

Re: Auth user with postgresql

Piotr Sikora February 17, 2012 04:06PM

Re: Auth user with postgresql

Giuseppe Tofoni February 17, 2012 06:30PM

Re: Auth user with postgresql

Piotr Sikora February 17, 2012 07:08PM

Re: Auth user with postgresql

Giuseppe Tofoni February 18, 2012 05:50AM

Re: Auth user with postgresql

Piotr Sikora February 18, 2012 09:20AM

Re: Auth user with postgresql

Giuseppe Tofoni February 18, 2012 01:46PM

Re: Auth user with postgresql

Piotr Sikora February 18, 2012 02:12PM

[PARTIAL SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni February 20, 2012 06:40PM

Re: [PARTIAL SOLVED] Re: Auth user with postgresql

ktm2 February 21, 2012 11:04AM

Re: [PARTIAL SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni February 21, 2012 11:46AM

Re: [PARTIAL SOLVED] Re: Auth user with postgresql

ktm2 February 21, 2012 12:04PM

Re[2]: [PARTIAL SOLVED] Re: Auth user with postgresql

Max February 21, 2012 02:12PM

Re: [PARTIAL SOLVED] Re: Auth user with postgresql

Piotr Sikora February 21, 2012 02:20PM

Re: [PARTIAL SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni February 21, 2012 02:24PM

Re[2]: [PARTIAL SOLVED] Re: Auth user with postgresql

Max February 21, 2012 09:04PM

Re: Re[2]: [PARTIAL SOLVED] Re: Auth user with postgresql

Edho Arief February 21, 2012 10:56PM

[SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni February 22, 2012 05:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 326
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