1

I'm facing the same as following issue. (13: Permission denied) while connecting to upstream:[nginx]

I tried some solutions, but I'm still having this issue.

2022/02/01 05:56:04 [crit] 4647#4647: *1 connect() to unix:/home/ec2-user/xxxx.sock failed (13: Permission denied) while connecting to upstream, client: 175.177.40.158, server: xxxx.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/ec2-user/xxxx.sock:/", host: "xxxx.com"

I changed setsebool and tried changed owner of the sock file.

getsebool -a | grep httpd
httpd_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_check_spam --> off
httpd_can_connect_ftp --> off
httpd_can_connect_ldap --> off
httpd_can_connect_mythtv --> off
httpd_can_connect_zabbix --> off
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
httpd_can_network_memcache --> off
httpd_can_network_relay --> on
httpd_can_sendmail --> off
httpd_dbus_avahi --> off
httpd_dbus_sssd --> off
httpd_dontaudit_search_dirs --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> off
httpd_execmem --> off
httpd_graceful_shutdown --> on
httpd_manage_ipa --> off
httpd_mod_auth_ntlm_winbind --> off
httpd_mod_auth_pam --> off
httpd_read_user_content --> off
httpd_run_ipa --> off
httpd_run_preupgrade --> off
httpd_run_stickshift --> off
httpd_serve_cobbler_files --> off
httpd_setrlimit --> on
httpd_ssi_exec --> off
httpd_sys_script_anon_write --> off
httpd_tmp_exec --> off
httpd_tty_comm --> off
httpd_unified --> off
httpd_use_cifs --> off
httpd_use_fusefs --> off
httpd_use_gpg --> off
httpd_use_nfs --> off
httpd_use_openstack --> off
httpd_use_sasl --> off
httpd_verify_dns --> off

What's wrong? Any idea? This is my nginx file. Very simple.

upstream hippo777 {
    server unix:/home/ec2-user/xxxx.sock fail_timeout=0;
}

server {
    listen   80;
    server_name  .xxxx.com;
    proxy_set_header Host $host;
    real_ip_header X-Forwarded-For;
    set_real_ip_from 10.0.0.0/8;

    location / {
        proxy_pass http://xxxx;
    }
}
naohide_a
  • 1,116
  • 2
  • 13
  • 30

0 Answers0