Welcome! Log In Create A New Profile

Advanced

Convert Apache require user to nginx

Posted by aduzsardi 
Convert Apache require user to nginx
August 27, 2015 10:36AM
Hello everybody,
Is there any way to use this kind of configuration in nginx ?
Basically , i wan't to allow access to a website only from internal network IP's and for a specific user from htpasswd.

I tried with if ( $remote_user != user_name ) , and limit_except but every time i was getting the 401 code included in the if statement.


<Proxy *>
AuthUserFile /var/htpasswd/htpasswd
AuthType Basic
AuthName "Auth Required"
Satisfy Any

<Limit GET POST>
Order Deny,Allow
Deny from all
Allow from x.x.x.x
Allow from x.x.x.x
Require user user_name
</Limit>
</Proxy>
Re: Convert Apache require user to nginx
September 22, 2015 03:46PM
I think this post might be helpful to get you started: http://www.cyberciti.biz/faq/linux-unix-nginx-access-control-howto/

--
SuperTCP for NGINX
www.supertcp.com
Re: Convert Apache require user to nginx
September 23, 2015 03:10AM
it would have been helpful if i could find any information about setting up user authentication on specific vhosts
the issue i'm having is that i have only one htaccess file with all the users/passwords in it for basic auth , but i only want to allow one specific user from that file on one or more specific vhosts , which i think is not supported by nginx , or is there some third party module ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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