1

I'm trying to set up FastCGI caching for my wordpress website running on nginx and using PHP-FPM. Currently, when I try to visit the site, all I get is a bland "Access denied.".

If I comment out fastcgi_cache drm_custom_cache from my nginx server block, everything works just fine.

tail /var/log/nginx/error.log first said:

FastCGI sent in stderr: "Access to the script '/var/www/domain.tld/html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: /ip masked/, server: domain.tld, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "domain.tld"

In response to the error, I tried adding security.limit_extensions = to /etc/php-fpm.d/www.conf.

Now, the error log states:

FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: failed to open stream: Success in Unknown on line 0 Unable to open primary script: /var/www/domain.tld/html (Permission denied)" while reading response header from upstream, client: /ip masked/, server: domain.tld, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "domain.tld"

Help appreciated.

6
  • What is your file system permission in /var/www/domain.tld/html?
    – Gnought
    Sep 3, 2016 at 3:18
  • @Gnought 755 on directories which I set and the remaining come from the wordpresss zip (the permissions are already set correctly. All the directories and files belong to nginx:nginx. The permissions are correct (as I said, the website is fine without fastcgi_cache drm_custom_cache in the server block.
    – Shreyas
    Sep 3, 2016 at 13:47
  • What is the fastcgi cache path?
    – Gnought
    Sep 3, 2016 at 17:16
  • @Gnought /dev/shm/nginx/. I also tried /var/cache/nginx/ I think.
    – Shreyas
    Sep 3, 2016 at 17:17
  • And what is the permission of the fastcgi cache path?
    – Gnought
    Sep 3, 2016 at 17:18

0

You must log in to answer this question.

Browse other questions tagged .