title: What is causing this 301 redirect?
body: <p>I have a problem with my server redirecting <code>http://www.mylesgray.com:8080/</code> -> <code>http://www.mylesgray.com/</code>.</p>
  
  <p>Here are my Nginx <code>default</code> and <code>fastcgi_params</code> config files:</p>
  
  <p><a href="https://gist.github.com/1745271">https://gist.github.com/1745271</a></p>
  
  <p><a href="https://gist.github.com/1745313">https://gist.github.com/1745313</a></p>
  
  <p>This is rather a nusance as I am trying to run a benchmark of <strong>Nginx w/ caching</strong> vs <strong>Varnish w/ caching on top of Nginx</strong> to see if there is any performance benefit of one over the other.</p>
  
  <p>As such I have straight Nginx w/ caching listening on port <code>8080</code> and varnish on port <code>80</code> which forwards any non-cached requests to Nginx on <code>localhost:8080</code>, so obviously what I want to do is run an <code>ab</code> benchmark on <code>http://www.mylesgray.com:8080/</code> and on <code>http://www.mylesgray.com/</code> to see the difference.</p>
  
  <p>Here are the results of <code>curl -I</code> on various addresses.</p>
  
  <pre><code># curl -I http://www.mylesgray.com:8080
  
  HTTP/1.1 301 Moved Permanently
  Server: nginx/0.7.65
  Date: Sun, 05 Feb 2012 12:07:34 GMT
  Content-Type: text/html; charset=UTF-8
  Connection: keep-alive
  X-Powered-By: PHP/5.3.2-1ubuntu4.7ppa5~lucid1
  X-Pingback: http://www.mylesgray.com/xmlrpc.php
  Location: http://www.mylesgray.com/
  
  # curl -I http://mylesgray.com
  
  HTTP/1.1 301 Moved Permanently
  Server: nginx/0.7.65
  Content-Type: text/html; charset=UTF-8
  X-Powered-By: PHP/5.3.2-1ubuntu4.7ppa5~lucid1
  X-Pingback: http://www.mylesgray.com/xmlrpc.php
  Location: http://www.mylesgray.com/
  Content-Length: 0
  Date: Sun, 05 Feb 2012 12:15:51 GMT
  X-Varnish: 1419774165 1419774163
  Age: 15
  Via: 1.1 varnish
  Connection: keep-alive
  
  # curl -I http://mylesgray.com:8080
  
  HTTP/1.1 301 Moved Permanently
  Server: nginx/0.7.65
  Date: Sun, 05 Feb 2012 12:16:08 GMT
  Content-Type: text/html; charset=UTF-8
  Connection: keep-alive
  X-Powered-By: PHP/5.3.2-1ubuntu4.7ppa5~lucid1
  X-Pingback: http://www.mylesgray.com/xmlrpc.php
  Location: http://www.mylesgray.com/
  </code></pre>
  
  <p>Then running <code>curl -I http://www.mylesgray.com</code> gives:</p>
  
  <pre><code># curl -I http://www.mylesgray.com
  
  HTTP/1.1 200 OK
  Server: nginx/0.7.65
  Content-Type: text/html; charset=UTF-8
  X-Powered-By: PHP/5.3.2-1ubuntu4.7ppa5~lucid1
  X-Pingback: http://www.mylesgray.com/xmlrpc.php
  Content-Length: 5132
  Date: Sun, 05 Feb 2012 12:07:29 GMT
  X-Varnish: 1419774133 1419774124
  Age: 30
  Via: 1.1 varnish
  Connection: keep-alive
  </code></pre>
  
  <p>So as you can see <code>80</code> is served by Varnish and <code>8080</code> by Nginx but I cannot find <strong>anywhere</strong> anything that does a 301 redirect, not in <code>nginx.conf</code> or in the <code>sites-enabled/default</code> file and I don't believe it is caused by Wordpress itself but an very much open to correction.</p>
  
  <p>Please help, this is driving me nuts!</p>
  
  <p>Myles</p>