errorloc
errorloc302
Return an HTTP redirection to a URL instead of errors generated by HAProxy
May be used in sections :
defaults frontend listen backend
yes
yes yes
yes yes
yes yes
yes
Arguments :
is the HTTP status code. Currently, HAProxy is capable of
generating codes 200, 400, 403, 408, 500, 502, 503, and 504.
Code 200 is emitted in response to requests matching a "monitor-uri" rule.
Note that both keyword return the HTTP 302 status code, which tells the
client to fetch the designated URL using the same HTTP method. This can be
quite problematic in case of non-GET methods such as POST, because the URL
sent to the client might not be allowed for something other than GET. To
work around this problem, please use "errorloc303" which send the HTTP 303
status code, indicating to the client that the URL must be fetched with a GET
request.
See also : "errorfile", "errorloc303"
errorloc303
Return an HTTP redirection to a URL instead of errors generated by HAProxy
May be used in sections :
defaults frontend listen backend
yes
yes yes
yes yes
yes yes
yes
Arguments :
is the HTTP status code. Currently, HAProxy is capable of
generating codes 400, 403, 408, 500, 502, 503, and 504.
Code 200 is emitted in response to requests matching a "monitor-uri" rule.
Note that both keyword return the HTTP 303 status code, which tells the client to fetch the designated URL using the same HTTP GET method. This solves the usual problems associated with "errorloc" and the 302 code. It is possible that some very old browsers designed before HTTP/1.1 do not support it, but no such problem has been reported till now. See also : "errorfile", "errorloc", "errorloc302"