Welcome! Log In Create A New Profile

Advanced

"port_in_redirect off" not working.

September 10, 2011 07:40AM
Hello,

I'm running nginx/1.0.5 behing Varnish and serving up static html. Whenever I visit a URL which is a directory but without a trailing slash, e.g. /blah, it redirects to the non-80 port which nginx is running on, e.g. server:5000/blah/. The config is as follows:

http {
include mime.types;
default_type application/octet-stream;
sendfile on;

server {
listen 5000;
server_name server.com;
root /path/html;

location / {
index index.html index.htm;
port_in_redirect off;
}
}
}

I've tried moving "port_in_redirect off" to http and server contexts, and setting "server_name_in_redirect off", to no avail. The Varnish configuration is as simple as can be and just looks for the request hostname and forwards to the nginx backend.

Regards,

Andrew
Subject Author Posted

"port_in_redirect off" not working.

carrierdetect September 10, 2011 07:40AM

Re: "port_in_redirect off" not working.

Maxim Dounin September 10, 2011 08:10AM

Re: "port_in_redirect off" not working.

carrierdetect September 10, 2011 09:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 205
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready