Welcome! Log In Create A New Profile

Advanced

Re: user authentication with nginx

Javi Lavandeira
August 20, 2012 09:34AM
You don't need to talk back to NGINX for that. Just make your script return a "Location:" header redirecting the user's web browser to his profile directory.

I think this is already outside of the scope of this list. Feel free to contact me in private.

--
Javier Lavandeira
http://www.lavandeira.net

On Aug 20, 2012, at 22:22, Bob Stanton <farseas@gmail.com> wrote:

> I want to send status back to nginx because of the map directive combined with the alias directive:
>
> events {
> }
> http {
> map $remote_user $profile_directory {
> default $remote_user;
> }
> server {
> root /var/www/sites/dyvn/http;
> location / {
> auth_request /auth.html;
> alias /var/www/sites/mysite.com/http/$profile_directory/;
> }
> }
> }
>
>
>
>
>
> On Mon, Aug 20, 2012 at 8:42 AM, Javi Lavandeira <javi@lavandeira.net> wrote:
> From what you've told us so far, it looks like you just want an HTML form and a CGI to process it and then send some HTML back to the user.
>
> You don't need to complicate things too much. Just set up FastCGI with your scripting language of choice, and don't worry about sending back an HTTP status code to NGINX. The web server needs to know the code only if you're going to implement error pages for common HTTP errors. Most of the time you just send a human-readable error message with your HTML.
>
>
> --
> Javi Lavandeira
>
> Twitter: @javilm
> Blog: http://www.lavandeira.net/blog
>
> On 2012/08/20, at 21:33, Bob Stanton <farseas@gmail.com> wrote:
>
>> How else would you do it?
>>
>> I don't want to use basic_auth because I want to be able to style my own form.
>>
>>
>>
>> On Mon, Aug 20, 2012 at 7:06 AM, Javi Lavandeira <javi@lavandeira.net> wrote:
>> Make your CGI/PHP/Python/Perl script return a "Status: xxx" header.
>>
>> I'm curious, why do you need to do it this way?
>>
>>
>> --
>> Javi Lavandeira
>>
>> Twitter: @javilm
>> Blog: http://www.lavandeira.net/blog
>>
>> On 2012/08/20, at 19:42, Bob Stanton <farseas@gmail.com> wrote:
>>
>>> Sorry for my lack of precision. I know how to do all the below, I just don't know how to tell nginx whether or not user authentication was successful.
>>>
>>> On Mon, Aug 20, 2012 at 12:45 AM, Javi Lavandeira <javi@lavandeira.net> wrote:
>>> Hello,
>>>
>>> On 2012/08/20, at 6:32, Bob Stanton <farseas@gmail.com> wrote:
>>>
>>>> I specifically want to supply my own form, get the username and PW, check it against my DB with a CGI program, and then pass values back to Nginx.
>>>
>>> Do you mean that you want to know how to create an HTML form, pass the parameters to a CGI, and then return an HTML output to the user?
>>>
>>> Regards,
>>>
>>> --
>>> Javi Lavandeira
>>>
>>> Twitter: @javilm
>>> Blog: http://www.lavandeira.net/blog
>>>
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

user authentication with nginx

Bob Stanton August 19, 2012 05:34PM

Re: user authentication with nginx

Jonathan Matthews August 19, 2012 06:26PM

Re: user authentication with nginx

Bob Stanton August 19, 2012 06:40PM

Re: user authentication with nginx

Francis Daly August 19, 2012 08:50PM

Re: user authentication with nginx

mike August 19, 2012 10:34PM

Re: user authentication with nginx

Javi Lavandeira August 20, 2012 12:46AM

Re: user authentication with nginx

Bob Stanton August 20, 2012 06:44AM

Re: user authentication with nginx

Javi Lavandeira August 20, 2012 07:08AM

Re: user authentication with nginx

Bob Stanton August 20, 2012 08:34AM

Re: user authentication with nginx

Javi Lavandeira August 20, 2012 08:44AM

Re: user authentication with nginx

Bob Stanton August 20, 2012 09:24AM

Re: user authentication with nginx

Javi Lavandeira August 20, 2012 09:34AM

Re: user authentication with nginx

smallfish August 20, 2012 10:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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