Welcome! Log In Create A New Profile

Advanced

Re: remove www from the url

Francis Daly
February 17, 2011 10:54AM
On Thu, Feb 17, 2011 at 09:44:10AM -0500, whiskybar wrote:

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: 310
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