Nginx 配置遇到問題

Zery發表於2017-04-12

connect() to 10.2.20.170:1009 failed (13: Permission denied) while connecting to upstream

現這個錯誤是因為selinux, linux安全增強的補丁導致的。

解決方法是禁用selinux的安全增強, 可以使用命令 setenforce 0來臨時禁用,或者通過修改配置檔案/etc/sysconfig/selinux 新增 SELINUX=disabled來永久禁用

然後重啟 reboot

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

  

相關文章