Tabla de Contenidos
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 UTF-8
agregar nocanon al ProxyPass para que no rompa los acentos en la URI
<Location "/tribunal-ws">
Include /etc/apache2/MR/ws.rosario.gob.ar/tribunal-ws/accesos.conf
# agregar nocanon para que no rompa los acentos en la URI
ProxyPass balancer://tcatws1_aworker/tribunal-ws nocanon
ProxyPassReverse balancer://tcatws1_aworker/tribunal-ws
</Location>
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>
Deshabilitar urls
Cómo evitar que haga proxypass de algunas rutas puntuales
ProxyPass /CHANGELOG.txt ! ProxyPass /INSTALL.mysql.txt ! ProxyPass /INSTALL.txt ! ProxyPass /LICENSE.txt ! ProxyPass /authorize.php ! ProxyPass /install.php ! ProxyPass /update.php ! ProxyPass / balancer://datos_hcluster/ ProxyPassReverse / balancer://datos_hcluster/
Debe estar configurado ProxyErrorOverride
<IfModule mod_proxy.c>
ProxyErrorOverride On
</IfModule>
Caducar cookies cuando un backend se cae
nofailover: (Off) If set to On, the session will break if the worker is in error state or disabled. Set this value to On if backend servers do not support session replication.
ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On