Fedora’s SELinux prevents nginx to read and write in a directory

I’ve pulled a git repo in /srv/poligon through Eclipse, so I could avoid messing with the permissions for the home directory while testing the changes on the localhost, too. After setting the directory’s permissions, a localhost’s nginx still wasn’t able to access pages there; SELinux is set to “enforcing” by default in Fedora 20, so you’ll need another permissions’ setting for the directory:

chcon -R -t httpd_sys_rw_content_t /srv/poligon/

After this change, nginx should be able to pass the pages to php-fpm without problems on a SELinux enforcing host.

Leave a Reply

Your email address will not be published. Required fields are marked *