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; satisfy any;
auth_basic "Restricted Area"; auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee; auth_basic_user_file htpasswd-ee;
## Allowd IP Address List
# allow 127.0.0.1;
# uncomment following to turn on IP-based restriction # Allowed IP Address List
# deny all; 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/ { location /ee/ {
autoindex on; autoindex on;
alias /var/www/shared/; alias /var/www/shared/;
satisfy any; include common/acl.conf;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
index index.php index.html index.htm; index index.php index.html index.htm;
location ~ ^/ee(.+\.php)$ { location ~ ^/ee(.+\.php)$ {
@ -60,19 +57,13 @@ location /phpmyadmin {
location /nginx_status { location /nginx_status {
stub_status on; stub_status on;
access_log off; access_log off;
satisfy any; include common/acl.conf;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
} }
location ~ ^/(status|ping) { location ~ ^/(status|ping) {
include fastcgi_params; include fastcgi_params;
fastcgi_pass php; fastcgi_pass php;
satisfy any; include common/acl.conf;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd-ee;
include common/allowed_ip.conf;
} }

Loading…
Cancel
Save