Opened 8 years ago

Last modified 6 years ago

#1145 new enhancement

Can't set redirection port to the port from the "Host" request header field

Reported by: exap@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.10.x
Keywords: Cc:
uname -a: Linux 4.8.10-1-ARCH #1 SMP PREEMPT Mon Nov 21 11:55:43 CET 2016 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.2


Currently you can't set the redirection port to the one that is specified by the HTTP Host field. There should be another possible value for port_in_redirection that does exactly this.

Example: The client requests path /test from the host The server now responds with a redirection to the location

Also, compare server_name_in_redirect and port_in_redirect, they strangely do very different things altough their names are similiar:

  • server_name_in_redirect on means the server name specified by the server_name directive is used
  • server_name_in_redirect off means the server name specified in the "Host" request header field is used


  • port_in_redirect on means the port specified by the listen directive is used
  • port_in_redirect off means that no port is send

This is not intuitive and also misleading because server_name_in_redirect off actually sends a server name in the redirection packet..

Change History (2)

comment:1 by Maxim Dounin, 8 years ago

See also #1000.

comment:2 by Maxim Dounin, 6 years ago

See also #1526.

Note: See TracTickets for help on using tickets.