Redirect Users to a Specific URL Based on the HTTP Status Code in Okta Access Gateway
Last Updated:
Overview
Administrators can redirect users to a specific error page based on the HTTP status returned from the Okta Access Gateway (OAG) application. Set a directive to intercept the errors through a policy that redirects users to the required URL.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Access Gateway (OAG)
Solution
How is a user redirected to a specific URL based on the HTTP status code?
Configure the application policy with an advanced directive to intercept errors and redirect users to a specific URL based on the HTTP status code.
- Edit the application and navigate to the policy section.
- Edit the root policy and select the Advanced tab.
- Add the following directive in the advanced section:
proxy_intercept_errors on;
error_page 404 502 503 504 https://okta.com;
NOTE: This policy redirects users to https://okta.com whenever the backend application receives an HTTP 404, 502, 503, or 504 error, or when the application is unresponsive.
4. Select Not Validated to validate the setting and save the application.
