最近在捣鼓 ng, 发现每次更新配置文件后, 就会 502
nginx -s reload
解决办法:
1: 永久关闭 selinux
[[email protected] ~]# VIM /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
2: 我们需要将 Nginx 添加至 SELinux 的白名单
- yum install policycoreutils-python
- sudo cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M mynginx
- sudo semodule -i mynginx.pp
来源: http://www.bubuko.com/infodetail-3445522.html