坑1:访问自定义 conf
报无权限
- “/etc/nginx/conf.d/foo.conf” failed (13: Permission denied)
解决方法;
# restorecon -R /etc/nginx/conf.d/
坑2:proxy 其他端口时,报无权限
- (13: Permission denied) while connecting to upstream:[nginx]
解决方法(-P 是写入磁盘,重启后也能生效):
# setsebool httpd_can_network_connect on -P
坑3:nginx 启动后,其他机器无法通过80访问
解决方法:
# firewall-cmd --add-service=http --permanent
firewall-cmd 命令更多例子,参考:firewall-cmd