HAProxy put maintenance mode even backend process return http 200 status

I can put my website on maintenance mode by using 'errorfile' haproxy option. errorfile 503 /etc/haproxy/errorfiles/maintenance503.http . In above case when haproxy receive 503 response code from backend haproxy show 503maintance.html page.

But what I want is even after haproxy receive 200 ok status from backend it should show customize page. I want to keep running backend process but block the access for users via load balancer. I have tried with errorfile 200 /etc/haproxy/errorfiles/maintenance200.http but it is not working.

I can redirect request using redir but I have to host maintenance.html on different server. Does anyone have idea how to achieve this with "errorfile"?

链接地址: http://www.djcxy.com/p/62744.html

上一篇: Haproxy域名设置

下一篇: HAProxy将维护模式甚至后端进程返回http 200状态