1. 程式人生 > >NGINX-html靜態頁面Access Denied

NGINX-html靜態頁面Access Denied

cgi 查找 3.5 scrip clas err acc div html

NGINX-html靜態頁面Access Denied,包括.js 和.png都無法顯示

more /var/log/nginx/error.log

"fastcgi://127.0.0.1:9000", host: "47.93.55.148", referrer: "http://47.93.55.148/"
2017/07/18 09:23:34 [error] 2756#0: *2 FastCGI sent in stderr: "Access to the script ‘/usr/share/nginx/html/ip‘ has been denied (see security.limit_extensions)"

查看日誌,發現,發現有這麽一段

whereis php-fpm 查找配置文件

php-fpm: /usr/sbin/php-fpm /etc/php-fpm.conf /etc/php-fpm.d /usr/share/man/man8/php-fpm.8.gz

vim /etc/php-fpm.d/www.conf

190 security.limit_extensions = .html .htm .php .js .css .jpg .jpeg .gif .png

默認只允許執行擴展名為.php

systemctl restart php-fpm

NGINX-html靜態頁面Access Denied