You are not logged in.

#1 2014-09-12 23:01:36

xypista
Member
Registered: 2014-07-31
Posts: 7

nginx + php-fpm -> php trying to parse everything in its folder.

I have a basic nginx setup with php-fpm. My nginx config

The /ps/index.php file has css and containts pictures (these are outside of <?php ?> tags as normal html).
When I first loaded the page the css and a pictures were missing. The 'systemctl status nginx' revealed that FastCGI has denied access to these files. Like so:

2014/09/13 00:16:44 [error] 2139#0: *96 FastCGI sent in stderr: "Access to the script '/srv/nginx/ps/error.gif' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 192.168.1.101, server: localhost, request: "GET /ps/error.gif HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "pi.lan", referrer: "http://pi.lan/ps/photoswipe.css"

If I set the security.limit_extensions in php-fpm.conf as blank (to allow all extensions) some of the pictures appear, some not and the css does't applied. The 'systemctl nginx status' shows something strange:

PHP message: PHP Parse error:  syntax error, unexpected ']' in /srv/nginx/ps/IMG_7643.jpg on line 2270" while reading response header from upstream, client: 192.168.1.101, server: localhost, request: "GET /ps/IMG_7643.jpg HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "pi.lan", referrer: "http://pi.lan/ps/index.php"

It seems that it tries to parse everything under the ps folder. How can I prevent this?

--

Nevermind... Wrong location settings in the config...

Last edited by xypista (2014-09-12 23:40:56)

Offline

Board footer

Powered by FluxBB