Welcome! Log In Create A New Profile

Advanced

Научите правильно писать локейшены

Ilya Lobahin
December 26, 2011 08:28AM
Здравствуйте, коллеги.

Есть сайт с php. На сайте хочется закрыть папу папок по IP от всех кроме себя.

Делаю так:
------------------------------------------
root /var/www/site/htdocs/;
index index.php index.html;
location /(path1|path2)/ {
allow 1.1.1.1;
deny all
}
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
}
------------------------------------------
В результате site/path1 открывается.

Но если сделать так:
---------------------------
root /var/www/site/htdocs/;
index index.php index.html;
location /path1/ {
allow 1.1.1.1;
deny all
}
location /path2/ {
allow 1.1.1.1;
deny all
}
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
}
---------------------------
То все работает как и задумано.

Как делать правильнее?

--
С уважением,
Лобахин Илья


_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Научите правильно писать локейшены

Ilya Lobahin December 26, 2011 08:28AM

Re: Научите правильно писать локейшены

Denis F. Latypoff December 26, 2011 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready