HTTP directives

proxy_redirect directive (HTTP)

Contexts: http, server, location. Default: default. Rewrites matching Location and Refresh response values; default is unavailable with variable-based proxy_pass.

Formal Syntax & Structure

nginx syntaxnginx
proxy_redirect default | off | redirect replacement;

Parameters & Attributes

NameTypeDescription
redirectdefault | off | string or expression | regexSelect automatic rewriting, cancel inherited rules, or match the original redirect.
replacementstring or expressionRequired for explicit matching form; may use regex captures.

Working Example

Example Snippetnginx
proxy_redirect http://catalog.test/ http://edge.test:18160/shop/;
Nginx Reference