Others have answers specific to Nginx, but as far as debugging goes, my bit of advice is to use curl
with the -I
option to see what the headers are for each domain. As the curl
documentation for -I
explains:
(HTTP) Include the HTTP-header in the output. The HTTP-header includes
things like server-name, date of the document, HTTP-version and
more...
For example, doing a curl -I
to google.com
returns this:
curl -I google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Wed, 09 Apr 2014 00:45:23 GMT
Expires: Fri, 09 May 2014 00:45:23 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic
The two key things you can get from this is the HTTP/1.1
response code which is a 301 Moved Permanently
and the Location:
which is connected to the HTTP/1.1
response code and sets the new location URL to be http://www.google.com/
. Now, let’s do a curl -I
to www.google.com
like so:
curl -I www.google.com
HTTP/1.1 200 OK
Date: Wed, 09 Apr 2014 00:47:28 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=79631a82c2c7cf67:FF=0:TM=1397004448:LM=1397004448:S=z010eeEdNjG129tJ; expires=Fri, 08-Apr-2016 00:47:28 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=e9j_a0lvogCKF-Mt-OdZKlRoMwaGJXis7yA0i0l1zKuh2mz_P5MUCsyzvPVhz9yBY2Wi04XzY2tn8UlqaT2i-rvVHGIAb1l1FwXm4wxvLtNTmSvREavLD6qDLeDBar2r; expires=Thu, 09-Oct-2014 00:47:28 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic
Transfer-Encoding: chunked
Note the HTTP/1.1
response code is 200 OK
, which means the URL is good & will load from that point on.
So in your case compare the header output for curl -I mysite.me
to curl -I www.mysite.me
and you can debug what’s happening.
mysite.me
andwww.mysite.com
? a typo ? The www version of your site should be resolved by your DNS. If it is not the case, fix this first.mysite.me
andwww.mysite.com
. Can you explain ?http://mysite.me
that works. Now you wanthttp://www.mysite.me
work also, is that right ?? assuming i am right, please post the results from these commands :nslookup mysite.me
andnslookup www.mysite.me