Welcome! Log In Create A New Profile

Advanced

Re: Why is redirect to the first server_name happening when visiting location without trailing slash?

October 27, 2009 09:54AM
Igor Sysoev wrote:
> On Tue, Oct 27, 2009 at 01:25:47PM +0300, Igor Katson wrote:
>
>> I have a following site config in nginx
>>
>> server {
>> listen 80;
>> server_name testsite.local nginx.test;
>>
>> root /tmp;
>>
>> location /video/ {
>> proxy_pass http://localhost:8080/;
>> }
>> }
>>
>> and the following line in /etc/hosts
>>
>> 127.0.0.1 localhost testsite.local nginx.test
>>
>> When i visit http://nginx.test/video , nginx redirects me to
>> http://testsite.local/video/, which is the behaviour, I don't expect at
>> all. It would be nice to redirect the same way, but to the same host, or
>> not redirect at all.
>>
>> How can I disable that behavior?
>
> server_name_in_redirect off;
>
>
Thank you, Igor. My mistake not looking in the docs first.
Subject Author Posted

Why is redirect to the first server_name happening when visiting location without trailing slash?

descentspb October 27, 2009 06:32AM

Re: Why is redirect to the first server_name happening when visiting location without trailing slash?

Igor Sysoev October 27, 2009 06:38AM

Re: Why is redirect to the first server_name happening when visiting location without trailing slash?

descentspb October 27, 2009 09:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
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