HTTP directives
error_page directive (HTTP)
HTTP core; http/server/location/if in location; no default. Selects error handling; optional override or handler-derived status. URI redirection changes non-GET/HEAD methods to GET; named location avoids that change. Inherited only when no error_page is defined at the current level.
Formal Syntax & Structure
nginx syntaxnginx
error_page code ... [=[response]] uri;Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| code | integer | One or more error statuses. |
| response | integer | Optional replacement status after =. |
| uri | string | Error target URI, named location or redirect URL. |
Working Example
Example Snippetnginx
error_page 404 /errors/404.html;