CentOS 6.6, SELinux breaks Nginx 1.6.0

richardm nginx-forum at nginx.us
Thu Oct 30 20:18:10 UTC 2014

An upgrade to Centos 6.6 seems to relabel the standard directories used by
nginx with "httpd_" tags. 

I have two Centos systems nginx installed from the nginx repo. Both were at
version 6.5 and showed, 

ls -lZ /etc/nginx/
drwxr-xr-x. root root system_u:object_r:etc_t:s0       conf.d
. . . 
-rw-r--r--. root root system_u:object_r:etc_t:s0       nginx.conf
. . .
ls -lZ /var/log/nginx/
. . .
-rw-r-----. webs  adm unconfined_u:object_r:var_log_t:s0 error.log
. . .

Then I updated one system to Centos 6.6. Nothing else. I didn't change nginx
at all, just ran "yum update". Then  
ls -lZ /etc/nginx
drwxr-xr-x. root root system_u:object_r:httpd_config_t:s0 conf.d
. . .
-rw-r--r--. root root system_u:object_r:httpd_config_t:s0 nginx.conf
. . .
ls -lZ /var/log/nginx/
. . .
-rw-r-----. webs  adm  unconfined_u:object_r:httpd_log_t:s0 error.log
. . .

If I use anything outside of the standard locations I must label it myself
or an nging restart will fail. For example, my socket for php-fpm fails. I
place logs in a different directory (not /var/log/nginx/) and so they fail

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,254456,254473#msg-254473

More information about the nginx mailing list