HTTP directives

port_in_redirect directive (HTTP)

Control port inclusion in Nginx-generated absolute redirects; check externally visible port behind a load balancer. Context: http, server, location. Documented default: on. Version: Introduction not established. OSS documentation; check target build. Example is a partial http configuration fragment; use a disposable lab, not a production tuning prescription.

Formal Syntax & Structure

nginx syntaxnginx
port_in_redirect on | off;

Parameters & Attributes

NameTypeDescription
stateon | offSelect whether this behavior is enabled.

Working Example

Example Snippetnginx
port_in_redirect on;
Nginx Reference