LiveStreet и Nginx вне WebDir
Наткнулся на интересную документацию, по установке LS на Nginx и тут же предложен один из способов борьбы с .htaccess. Быть может, кому-то пригодится.
<server {
set $path_to_project /var/www/girlstogether.ru;
server_name yourservername.ru;
listen 80;
access_log /$path_to_project/logs/access.log;
root $path_to_project/htdocs;
autoindex off;
location ~ \.php$ {
try_files $uri = 404
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $path_to_project/htdocs$fastcgi_script_name;
}
location @main {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $path_to_project/htdocs/index.php;
}
location / {
try_files $uri
@main;
allow all;
}
}
location ~ \.(jpg|jpeg|bmp|jif|bmp|gif|png)$ {
root /path/to/public_html/;
valid_referers server_names none blocked www.othersite.com *.othersite.com;
if ($invalid_referer) {
return 403;
}
}
"HTTP/1.1 404 Not Found"
на "{$_SERVER['SERVER_PROTOCOL']} 404 Not Found"