Browse Source

Protect Locations Using HTTP AUTH OR IP-Based Authentication

old-stable
Mitesh Shah 11 years ago
parent
commit
2a9ac4b2cc
  1. 9
      etc/nginx/common/acl.conf
  2. 3
      etc/nginx/common/allowed_ip.conf
  3. 15
      etc/nginx/common/locations.conf

9
etc/nginx/common/acl.conf

@ -1,9 +1,8 @@
# Protect Locations Using HTTP AUTH OR IP-Based Authentication
satisfy any;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
## Allowd IP Address List
# allow 127.0.0.1;
# uncomment following to turn on IP-based restriction
# deny all;
# Allowed IP Address List
allow 127.0.0.1;
deny all;

3
etc/nginx/common/allowed_ip.conf

@ -1,3 +0,0 @@
# Allowd IP Address
allow 127.0.0.1;
deny all;

15
etc/nginx/common/locations.conf

@ -25,10 +25,7 @@ location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gi
location /ee/ {
autoindex on;
alias /var/www/shared/;
satisfy any;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
include common/acl.conf;
index index.php index.html index.htm;
location ~ ^/ee(.+\.php)$ {
@ -60,19 +57,13 @@ location /phpmyadmin {
location /nginx_status {
stub_status on;
access_log off;
satisfy any;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
include common/acl.conf;
}
location ~ ^/(status|ping) {
include fastcgi_params;
fastcgi_pass php;
satisfy any;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
include common/acl.conf;
}

Loading…
Cancel
Save