Environment
- centos 7.6
- nginx version: nginx/1.20.1
- Nginx proxy 8989 traffic to IP: 8081
Phenomenon
After completing the Nginx reverse proxy configuration, /var/log/nginx/error.log reports an error
2021/08/20 16:23:52 [crit] 11490#11490: *5 connect() to IP:8081 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: “GET / HTTP/1.1″, upstream: ” http://IP:8081/ “, host: “127.0.0.1:8989”
Deal with
- Try to close Selinux, it runs normally
setenforce 0
systemctl restart nginx.service
- Generate PP file to join Selinux
cd /var/log/nginx
cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M mynginx
semodule -i mynginx.pp
Similar Posts:
- How to Solve Nginx Error 13: Permission denied) while connecting to upstream
- Solutions to start failed after dhcpd installation
- Solutions to start failed after dhcpd installation
- [Solved] Nginx proxy Timeout: upstream timed out (110: Connection timed out)
- Aapache can’t start, error message: suexec mechanism enabled (wrapper: / usr / SBIN / suexec)
- Nginx Timeout Error: upstream timed out (110: Connection timed out) while reading response header from ups…
- How to Solve Nginx error: 403 Forbidden
- Nginx normal user startup configuration error: && springboot-swagger & Unable to infer base url
- Solving the problem of nginx reverse proxy web service soap:address location problem
- Visit the back-end application through nginx and report an error err_ CONTENT_ LENGTH_ MISMATCH