Apache require user to nginx

Discussion in 'Server Operation' started by TiTex, Aug 28, 2015.

  1. TiTex

    TiTex Member

    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.
    The idea is that i want to allow unlimited access for LAN IP addresses and for an outside client with one specific username/password form the htpassword file

    <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

Share This Page