File Contexts For Nginx

 

$ vi /etc/selinux/targeted/contexts/files/file_contexts       增加下面的内容:

#
# nginx file contexts
#

/etc/nginx(/.*)?        system_u:object_r:httpd_config_t
/usr/share/nginx(/.*)?        system_u:object_r:httpd_sys_content_t
/usr/sbin/nginx        --    system_u:object_r:httpd_exec_t
/var/lib/nginx(/.*)?        system_u:object_r:httpd_cache_t
/var/log/nginx(/.*)?        system_u:object_r:httpd_log_t
或者:
sudo semanage fcontext -a -t httpd_config_t "/etc/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_sys_content_t "/usr/share/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_exec_t -f -- /usr/sbin/nginx
sudo semanage fcontext -a -t httpd_cache_t "/var/lib/nginx(/.*)?"
sudo semanage fcontext -a -t httpd_log_t "/var/log/nginx(/.*)?"

重新标记nginx包:

$ sudo /sbin/fixfiles -R nginx relabel

 

你可能感兴趣的:(nginx,cache,F#)