If an action blocks or redirects traffic, do the subsequent actions run?
Short answer
No. When an action that terminates the request at the request stage (such as Block, Show Content, Location Redirection, User Authentication (On HTTP request), Provide Prometheus Service) is triggered, the request actions that come after it in the list do not run for that request (action order). Since TR7 produces the response itself, the request does not go to the Backend Service, and the On Response actions applied to the Backend Service response do not run either. Actions such as adding a header or changing the path do not terminate the request; the subsequent actions continue to run.
How Does It Work?
- Request actions are tried in the order of the vService's Actions list, each according to its own condition.
- If a terminating action is triggered, TR7 produces the response itself or closes the connection; it does not move on to the next request actions.
- Since the request does not go to the Backend Service, the On Response actions applied to the response coming from the server do not run either.
| Terminates | Does not terminate |
|---|---|
| Block | Add / Delete / Set HTTP header, Replace HTTP Header Content |
| Show Content | Set Path, Set Path + Query |
| Location Redirection | Create Traffic Variable |
| User Authentication (On HTTP request): on an unauthenticated request | Conditional Silent Log |
| Provide Prometheus Service | URL Normalization |
| TCP Connection Management: Reject, Silent Drop | Ip Log Masking |
| Quarantine: the blocking, redirection or content display applied while the client is in quarantine |
What to Know in TR7
- Hit Counter and Set Variable on Hit are processed immediately before the action's own line; the count and the variable assignment are not lost for terminating actions either.
- Redirect to HTTPS, Advanced CAPTCHA and Traffic Mirroring take effect after the other request actions, regardless of their position in the list; a Block or Show content further down the list also prevents them (In what order do Actions run; how do I change the order?).
- The Accept option of the TCP Connection Management action does not cut the connection; however, when it is triggered, the subsequent TCP actions are not evaluated for that connection.
- HTTP Cookie Security is also applied to the responses that TR7 produces itself.
- On Response Block cuts the response before it reaches the client; the request has already been processed on the Backend Service.
Common Misconceptions
- "A header action that comes after Block is also added to the blocked request." For a blocked request, the subsequent request actions do not run.
- "No count is kept for a blocked request." If Hit Counter is on, terminating actions are also counted.
- "Blocking at the response stage stops the request." On Response Block only cuts the response; the server has already processed the request. If the request must not reach the server, Block is used at the On Request phase.
- "If Redirect to HTTPS is at the top of the list, it runs first." The list order does not change the moment at which Redirect to HTTPS runs.
How it is done in the documentation
