Short explanation afterwards
https://www.zagirov.name/post/nginx-config/
manual - http://nginx.org/ru/docs/http/ngx_http_core_module.html#location
Example: how to open phpinfo.php only for 1.2.3.4 address
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/dev/shm/php-user72.sock;
deny all;
}
location ^~ /phpinfo {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/dev/shm/php-user72.sock;
allow 1.2.3.4;
deny all;
}
Prefix location with ^~ disables first regexp location.
Комментариев нет:
Отправить комментарий