we have created a rule that only triggers if the response code is 502 in the response cycle. When I try to check if it has been triggered in the rule tracing centre, the ruleset does not show up. Also in the "Cycle" drop down only "All, Request" is shown but no response. Does it need to be enabled separately?
right, there is not 502 in response, unless it comes from an upstream proxy.
In a normal case, say if a timeout occurs, there is no "response", the proxy either cannot connect to destination if the DNS resolution fails, there is no "response" if the proxy runs in a timeout, or receives a TCP RESET. So the 502 is thrown by the proxy module itself and not by the rule set. There is no way to do something in the current transaction, because it is over and terminated.
What you need to do as an action if the response code 502 returned back? You can place your rule in the logging cycle, this will work.
Here are other more specific properties, that you can use to fine tune your rule:
Protocol.FailureDescription - Holds an error message when a protocol error has occurred, like: ":errno: 104 - 'Connection reset by peer' on socketfd 283:server state 8:state 9:Application response 502 cannotconnect"
Message.TemplateName - Contains the file name for a block message
let me know if it works for you.
first try to modify default 502 pages under Policy > Templates > Default Schema.
You'll find several 502-related block messages:
Proxy: Bad Gateway
Proxy: Cannot Connect
Proxy: Not Resolvable
may be other..
Hello and thank you for your response.
If I create a policy and try to read the value of "Response.StatusCode". I receive the value 0. If i see the details of the request i see the value 502.
If want to show the user a specific template if it receives the value 502.
you need modify the before mentioned Proxy error pages that are shown at 502 errors.
New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.
Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership: