Apache反向代理返回503 Service Unavailable
–httpd.conf
<VirtualHost *:80>
ServerName ip
ProxyRequests Off
<Proxy *>
Require all granted
ProxyPass /service http://ip:port/service
ProxyPassReverse /service http://ip:port/service
–Postman返回
503 Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
–/etc/httpd/logs/error_log
Permission denied: AH00957: HTTP: attempt to connect to **********(*****) failed
AH01114: HTTP: failed to make connection to backend: 192.168.199.115
– 猜测SELinux影响
#/usr/sbin/getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
– 把httpd_can_network_connect设置为on
#/usr/sbin/setsebool -P httpd_can_network_connect=1
#/usr/sbin/getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
或者修改/etc/selinux/config文件中的SELINUX="disabled“ ,然后重启。
重新发送请求试一下~