nginx代理tomcat error.log报错502 (13: Permission denied) while connecting to upstream

一开始以为是nginx权限问题,把nginx启动用户改成root,无果
因为是yum包方式安装,又换成编译安装,无果
觉得可能是权限的问题,考虑换成root权限部署tomcat
翻看之前的笔记,在装nginx之前关过selinux,试了一下可以

故:解决方案 参考https://blog.csdn.net/unhejing/article/details/104705060

# 临时写入selinux放行
setsebool httpd_can_network_connect=1
# 永久写入selinux放行
setsebool -P httpd_can_network_connect 1

selinux介绍https://www.linuxprobe.com/selinux-introduction.html

猜你喜欢

转载自blog.csdn.net/sxhexin/article/details/109023577