linux:web:apache.mod_proxy
**¡Esta es una revisión vieja del documento!**
Mod Proxy
Let's clear that apache mod_proxy does not have a health check mechanism embedded, it updates the status of your backend based on responses on real requests.
So your current configuration works as following:
- Request arrives on apache
- Apache send it to an alive backend
- If request gets an error http code for response or doesn't get a response at all, apache puts that backend in ERROR state.
- After retry time is passed apache sends to that backend server requests again.
So reading the above you understand that the first request that will reach a backend server which is down will get an error page.
One of the things you can do is indeed ping, according to the docs will check the backend before send any request. Consider of course the overhead that produces.
mod_proxy_hcheck
ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/}
ProxyHCExpr gdown {%{REQUEST_STATUS} !~ /^[5]/}
ProxyHCExpr in_maint {hc('body') !~ /Under maintenance/}
ProxyHCExpr in_maint_dp {hc('body') !~ /Sitio desconectado en mantenimiento/}
#ProxyHCExpr in_maint_dp {hc('body') !~ /mantenimiento/}
ProxyHCExpr in_maint_ver {hc('body') !~ /1.3.0-rc12/}
LogLevel proxy_hcheck:TRACE2
<Proxy balancer://mvr_hcluster>
BalancerMember http://mvr1-test.pm.rosario.gov.ar route=mvr1-test timeout=60 retry=1 acquire=2000 hcmethod=GET hcinterval=2 hcuri=/static/VERSION hcexpr=in_maint_ver
# BalancerMember http://mvr2-test.pm.rosario.gov.ar route=mvr2-test timeout=60 retry=1 acquire=2000 hcexpr=in_maint_ver
Header append Via %{BALANCER_WORKER_ROUTE}e
</Proxy>
linux/web/apache.mod_proxy.1593194019.txt.gz · Última modificación: 2020/06/26 17:53 por grillo