How to check HTTP response code of a secured website with Nagios?

I have tried using check_http but I get success even if the website is redirected to an error page This can be solved with check_http –expect. Here is the documentation from check_http –help: -e, –expect=STRING Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response … Read more

How do I configure nginx to return 429 http code when rate limiting?

Good news, with Version 1.3.15 http://mailman.nginx.org/pipermail/nginx/2013-March/038306.html we have the “limit_req_status” and “limit_conn_status” directives. I just tested them on Gentoo Linux (note that you need to have the modules limit_req and limit_con compiled in). With these settings I think you can achieve what you’ve asked for: limit_req_status 429; limit_conn_status 429; I have verified this with a … Read more

How can I use a custom 503 error document when HAProxy sends a 503 HTTP code?

You can use the errorfile directive and then a custom .http text file. So for example: errorfile 503 /etc/haproxy/errors/503-mycustom.http Content of the file would then be something like: HTTP/1.0 503 Service Unavailable Cache-Control: no-cache Connection: close Content-Type: text/html <html> <head> <title>RARRR!!!!!</title> </head> <body style=”font-family:Arial,Helvetica,sans-serif;”> <div style=”margin: 0 auto; width: 960px;”> <h2 >RAWR RAWR RAWR</h2> </div> … Read more