Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Convert Apache require user to nginx

$
0
0
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>

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>