Welcome! Log In Create A New Profile

Advanced

Re: Auth user with postgresql

Giuseppe Tofoni
February 17, 2012 03:26PM
Hi, Piotr Sikora

I followed your instructions but when I start nginx the following error:

nginx: [emerg] the duplicate "remote_passwd" variable in
/etc/nginx/nginx.conf:60

.........
location =/t1
{
internal;
more_set_headers -s 401 'WWW-Authenticate: Basic
realm="Cartella test1"';
postgres_escape $user $remote_user;

set_md5 $remote_passwd;
postgres_escape $pass $remote_passwd;

postgres_pass database;
postgres_query "SELECT user FROM usertable WHERE
user=$user AND pwd=$pass";
postgres_rewrite no_rows 401;
postgres_output none;
}
.............
How can I solve the problem?
Many thanks again.

Giuseppe

p.s.:it is normal to immediately start nginx requires authentication
to the database?

2012/2/17 Piotr Sikora <piotr.sikora@frickle.com>:
> Hi,
>
>
>> The login and password is okay, but in my database passwords are
>> stored in MD5, while the password is passed in the clear as I can
>> solve the problem?
>
>
> You can use "set_md5" directive from ngx_set_misc module [1]:
>
>   set_md5 $remote_passwd; /* must be before postgres escape */
>   postgres_escape $pass $remote_passwd;
>
> [1] https://github.com/agentzh/set-misc-nginx-module
>
>
> Best regards,
> Piotr Sikora < piotr.sikora@frickle.com >
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
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: 198
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