1
1
1serfer2014-04-16 19:25:43
Nginx
1serfer, 2014-04-16 19:25:43

Centos, Nginx - .htm, .xml files do not open, security.limit_extensions error, how to fix?

I will make a reservation in advance, the solutions that are on the toaster did not fit
Centos, Nginx in my case.
Problem:
php files, pictures, css open, but html, xml do not want to.
On my local machine, the nginx config of the host is the same as on the product, and it shows everything locally: html, xml and other useful files, so I don’t post it.
The solution to the problem of file rights is not relevant.
Mistake:
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"
File /etc/php-fpm.d/www.conf:
....
security.limit_extensions = .html .xml .php .php3 .php4 .php5
....
But that doesn't help (server reboots were).
What could it be?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fadmin, 2014-04-16
@1serfer

It looks like you are editing the config for the wrong pool:
fastcgi://127.0.0.1:9001
and
listen = 127.0.0.1:9000

1
1serfer, 2014-04-16
@1serfer

The server was repeatedly rebooted (as a whole) and separately services: nginx, php-fpm
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_logoff;
location ~ /\. {
deny all; access_logoff; log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_logoff;
}
location = /robots.txt {
allow all;
log_not_found off;
access_logoff;
}
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_logoff; 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;
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question