Syntax: | internal; |
---|---|
Default: | — |
Context: | location |
Specifies that a given location can only be used for internal requests. For external requests, the client error 404 (Not Found) is returned. Internal requests are the following:
- requests redirected by the error_page, index, random_index, and try_files directives;
- requests redirected by the “X-Accel-Redirect” response header field from an upstream server;
- subrequests formed by the “
include virtual
” command of the ngx_http_ssi_module module and by the ngx_http_addition_module module directives; - requests changed by the rewrite directive.
Example:
error_page 404 /404.html; location /404.html { internal; }
There is a limit of 10 internal redirects per request to prevent request processing cycles that can occur in incorrect configurations. If this limit is reached, the error 500 (Internal Server Error) is returned. In such cases, the “rewrite or internal redirection cycle” message can be seen in the error log.
Please login to continue.