I want to secure a folder with username and password. The password should only be needed when accessing the server from outside its network. (192.168.0.0/24)
I tried using .htaccess, but it ignores my
AuthType Basic AuthName "pw" AuthUserFile /var/www/folder/.htpasswd Require valid-user Order allow,deny Allow from 192.168.0.0/255.255.255.0 satisfy any
I am not sure if the
Allow from line is correct. Nginx forwards the headers to Apache, so the "real IP" is seen from Apache too.
Would the password protection easier with nginx?