Centos, Nginx — файлы .htm, .xml не открываются, ошибка security.limit_extensions, как исправить?

Оговорюсь заранее, решения, которые есть на тостере, в моём случае не подошли

Centos, Nginx

Проблема:
php файлы, картинки, css открываются а вот html, xml ни в какую не хотят.

На моей локальной машине конфиг nginx хоста такой же, как и на продакте, и локально всё показывает: html, xml и другие полезные файлы, поэтому его не выкладываю.
Решение проблемы правами на файлы не актуально.

Ошибка:

2014/04/16 12:45:15 [error] 127#0: *92 FastCGI sent in stderr: "Access to the script '/var/www/host.com/sim_sim_open_the_door.html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 77.122.44.218, server: host.com, request: "GET /sim_sim_open_the_door.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "www.host.com"

Файл /etc/php-fpm.d/www.conf:
....
security.limit_extensions = .html .xml .php .php3 .php4 .php5
....

Но это не помогает (перезагрузки сервера были).

Что это может быть?
Спасибо.
  • Вопрос задан
  • 5274 просмотра
Решения вопроса 1
Fadmin
@Fadmin
Похоже вы не для того пула правите конфиг:
fastcgi://127.0.0.1:9001
и
listen = 127.0.0.1:9000
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@1serfer Автор вопроса
Неоднократно перегружались сервер (целиком) и по отдельности службы: nginx, php-fpm

nginx файл домена host.com.vhost

server {
listen *:80;

server_name host.com www.host.com;

root /var/www/host.com/public_html;

if ($http_host = "host.com") {
rewrite ^ $scheme://www.host.com$request_uri? permanent;
}

index index.html index.htm index.php index.cgi index.pl index.xhtml;

error_log /var/log/host.com/error.log;
access_log off;

location ~ /\. {
deny all; access_log off; log_not_found off;
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location /stats {
index index.html index.php;
auth_basic "Members Only";
auth_basic_user_file /var/www/host.com/stats/.htpasswd_stats;
}

location ^~ /awstats-icon {
alias /usr/share/awstats/icon;
}

location ~* ^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|swf|flv|xls|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
log_not_found off;
expires 1d;
}
location ~* ^.+.(css|js)$ {
access_log off;
log_not_found off;
}

server_tokens off;
error_page 400 /400.php;
error_page 401 /401.php;
error_page 403 /404.php;
error_page 404 /404.php;
error_page 405 /405.php;
error_page 500 /500.php;
error_page 502 /502.php;
error_page 503 /503.php;
recursive_error_pages off;
fastcgi_intercept_errors on;

client_max_body_size 20m;
client_body_buffer_size 128k;


location ^~ /cgi-bin {
return 404;
}

location ~ \.(tpl|log|sql)$ {
deny all; access_log off; log_not_found off;
}

location ~* \.php$ {
if (!-e $document_root$document_uri){return 404;}

fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9001;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}

location / {

fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

root /var/www/host.com/public_html;
}

location /administrators/ {
auth_basic "Members Only";
auth_basic_user_file /var/www/.htaccess/.htpasswd;
}

}
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы