401 when an authentication is required to perform the action (when
accessing the stats page)
403 when a request is forbidden by a "http-request deny" rule
+ 404 when the requested resource could not be found
408 when the request timeout strikes before the request is complete
410 when the requested resource is no longer available and will not
be available again
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 410, 425, 429, 500, 502,
- 503, and 504.
+ generating codes 200, 400, 403, 404, 405, 408, 410, 425, 429, 500,
+ 502, 503, and 504.
<file> designates a file containing the full HTTP response. It is
recommended to follow the common practice of appending ".http" to
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 410, 425, 429, 500, 502,
- 503, and 504.
+ generating codes 200, 400, 403, 404, 405, 408, 410, 425, 429, 500,
+ 502, 503, and 504.
<url> it is the exact contents of the "Location" header. It may contain
either a relative URI to an error page hosted on the same site,
yes | yes | yes | yes
Arguments :
<code> is the HTTP status code. Currently, HAProxy is capable of
- generating codes 200, 400, 403, 405, 408, 410, 425, 429, 500, 502,
- 503, and 504.
+ generating codes 200, 400, 403, 404, 405, 408, 410, 425, 429, 500,
+ 502, 503, and 504.
<url> it is the exact contents of the "Location" header. It may contain
either a relative URI to an error page hosted on the same site,
[HTTP_ERR_200] = 200, /* used by "monitor-uri" */
[HTTP_ERR_400] = 400,
[HTTP_ERR_403] = 403,
+ [HTTP_ERR_404] = 404,
[HTTP_ERR_405] = 405,
[HTTP_ERR_408] = 408,
[HTTP_ERR_410] = 410,
"\r\n"
"<html><body><h1>403 Forbidden</h1>\nRequest forbidden by administrative rules.\n</body></html>\n",
+ [HTTP_ERR_404] =
+ "HTTP/1.1 404 Not Found\r\n"
+ "Content-length: 83\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/html\r\n"
+ "\r\n"
+ "<html><body><h1>404 Not Found</h1>\nThe resource could not be found.\n</body></html>\n",
+
[HTTP_ERR_405] =
"HTTP/1.1 405 Method Not Allowed\r\n"
"Content-length: 146\r\n"
case 200: return HTTP_ERR_200;
case 400: return HTTP_ERR_400;
case 403: return HTTP_ERR_403;
+ case 404: return HTTP_ERR_404;
case 405: return HTTP_ERR_405;
case 408: return HTTP_ERR_408;
case 410: return HTTP_ERR_410;