Welcome! Log In Create A New Profile

Advanced

Re: remove www from the url

February 17, 2011 11:15AM
Hi Francis,

it must have been for my bad understanding of "if the header match name of server_name directive". I did not understand what "name of server_name directive" was -- of course, mysite.com matches the directive, you are right!

Then, it was the change of the server_name_in_redirect's default in 0.8.48 in addition to that - as you said. I'm running 0.9.x everywhere and this is why it stopped working. I only did not notice.

That was a very clear explanation of you Francis, thank you. I'm definitely not using this as everyone here suggested against it and I will be using the two server solution.

Jiri






mysite.com matches the seconds word of server_name and that means it matches the directive, you are right! Then, it

> Hi there,
>
> By now you've seen the "approved" way to do what
> you want.
>
> But it looks to me as if the behaviour you see is
> to be expected, based
> on the documentation you quote:
>
> > "Note that if a redirect is relative (has no
> host part), then
> > when redirecting Nginx uses the "Host" header if
> the header match name
> > of server_name directive
>
> Host header is www.mysite.com. server_name
> includes www.mysite.com. So you
> rewrite http://www.mysite.com/abc to
> http://www.mysite.com/abc. It's quite
> reasonable for a browser to report that this isn't
> a useful redirect,
> exactly as Firefox does.
>
> Other than a little bit of grammar, the
> documentation looks correct.
>
> > Well, this method no longer works. I do not know
> when it stopped working
>
> Most likely it was in 0.8.48, where the default
> value for
> server_name_in_redirect was set to "off".
>
> That suggests that you could, if you wanted to
> avoid the
> "proper" way, keep your current configuration and
> add an explicit
> "server_name_in_redirect on".
>
> If you included mention of the previous and
> current versions used,
> it might show that that analysis is incorrect.
>
> All the best,
>
> f
> --
> Francis Daly francis@daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

remove www from the url

whiskybar February 17, 2011 09:44AM

Re: remove www from the url

Jim Ohlstein February 17, 2011 09:52AM

Re: remove www from the url

edogawaconan February 17, 2011 09:52AM

Re: remove www from the url

Luit van Drongelen February 17, 2011 09:54AM

Re: remove www from the url

Dayo February 17, 2011 10:03AM

Re: remove www from the url

Jim Ohlstein February 17, 2011 10:12AM

Re: remove www from the url

Dayo February 17, 2011 10:34AM

Re: remove www from the url

whiskybar February 17, 2011 10:08AM

Re: remove www from the url

Igor Sysoev February 17, 2011 10:18AM

Re: remove www from the url

Francis Daly February 17, 2011 10:54AM

Re: remove www from the url

whiskybar February 17, 2011 11:15AM

Re: remove www from the url

Francis Daly February 17, 2011 06:46PM

Re: remove www from the url

lifeisjustabout February 17, 2011 11:31PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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