我有Apache反向代理服务器,它将请求代理到我的内部Apache服务器。我在Linux平台上使用Apache2.4版。
每当后端Apache服务器花费超过60秒时,我就会遇到超时页面和HTTP错误504 ( PHP页面等待后端Apache服务器上Mysql查询的结果)
Apache默认超时设置为300秒。
此问题仅在通过apache反向代理访问网站时出现。通过使用内部IP,工作正常。
我尝试将下面的参数设置为proxypass,但没有成功。
ProxyPass / http://internal-ip:8080/ retry=1 acquire=3000 timeout=600 Keepalive=On
我还尝试在不存在的IP上执行ProxyPass操作,60秒后也显示504HTTP错误
请帮助我理解这个问题。
<VirtualHost *:80>
ServerName mywebsite.example.com
ServerAlias www.mywebsite.example.com
ProxyPreserveHost On
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/mywebsite.example.com-error.log
CustomLog ${APACHE_LOG_DIR}/mywebsite.example.com-access.log combined
RewriteCond %{REQUEST_METHOD} !^(GET|POST)$
RewriteRule .* - [R=405,L]
ProxyPass /.static-pages !
ProxyPass / http://<Internal Apache Server IP>/
ProxyPassReverse / http://<Internal Apache Server IP>/
</VirtualHost>
发布于 2019-01-21 20:42:24
我遇到了完全相同的问题,并通过以下方式解决:
ProxyRequests off
Timeout 600
ProxyTimeout 600
<Proxy balancer://Mycluster>
BalancerMember http://url:80
ProxySet lbmethod=byrequests timeout=600
</Proxy>
ProxyPass / balancer://Mycluster/ timeout=600
https://stackoverflow.com/questions/54103802
复制相似问题