由于SELinux造成的。
2021/02/08 02:52:08 [crit] 26501#0: *17 connect() to 127.0.0.1:8094 failed (13: Permission denied) while connecting to upstream, client: 192.168.51.86, server: _, request: "GET /api/info HTTP/1.1", upstream: "http://127.0.0.1:8094/api/info", host: "192.168.3.15"
如果nginx上的api网关代理传递的centos api url抛出“ 502 Bad Gateway”错误,请运行以下命令来解决问题
sudo setsebool -P httpd_can_network_connect 1
网友评论