我有Apache反向代理服务器,它将代理请求发送到我的内部Apache服务器。我正在Linux平台上使用Apache2.4版本。
每当后端Apache服务器花费超过60秒时,我遇到超时页和HTTP错误504 ( PHP页面等待后端Apache服务器上Mysql查询的结果)。
Apache默认超时设置为300秒。
这个问题只有在通过apache反向代理访问网站时才会出现。它通过使用内部IP很好地工作。
我试图设置下面的参数为代理程序,但没有运气。
ProxyPass / http://internal-ip:8080/ retry=1 acquire=3000 timeout=600 Keepalive=On我还尝试在不存在的IP上使用ProxyPass,60秒后也会显示504HTTP错误
请帮助我理解这个问题。
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:///
ProxyPassReverse / http:///发布于 2020-01-22 14:56:06
使用ProxyPass指令,您可以考虑connectiontimeout参数。
请参阅Apache mod_proxy文档:https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#workers
connectiontimeout参数设置Apache等待创建到后端的连接以完成的秒数。
参数默认值为60.
https://serverfault.com/questions/948312
复制相似问题