Dev
April 15, 2010 04:42PM
Добрый день,

подскажите пожалуйста почему запрос вида http://site.com/test/ выдает 403, а
http://site.com/test/index.php выдает index ?
как всетаки правильно ограничить доступ в папку с пхп скриптами, принимая во
внимание тот факт что весь сайт на пхп, и есть другие папки с пхп к которым
доступ должен быть открыт.
конфиг:

server {
listen 127.0.0.1;
servername site.com;
root /home/virtual/site.com/html;
index index.php;

location ~ ^/test/
{

root /home/virtual/site.com/html/test;

try_files $uri $uri/index.php
@php;

allow
217.xx.xx.xx;

deny
all;

}


location ~ \.php$
{

include
/etc/nginx/fastcgi_params;

try_files $uri
=403;

fastcgi_pass
unix:/tmp/php-fastcgi.sock;

fastcgi_index
index.php;

fastcgi_param SCRIPT_FILENAME /home/virtual/
site.com/html$fastcgi_script_name;

fastcgi_param REMOTE_USER
$remote_user;

}
location @php
{

include
/etc/nginx/fastcgi_params;

fastcgi_pass
unix:/tmp/php-fastcgi.sock;

try_files $uri
=403;

fastcgi_index
index.php;

fastcgi_param REMOTE_USER
$remote_user;

fastcgi_param SCRIPT_FILENAME /home/virtual/
site.com/html$fastcgi_script_name;

}

}

С уважением,
Евгений.
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

как ограничить доступ к папке с пхп скриптами и другими файлами?

Dev April 15, 2010 04:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
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