我的服务器重定向有问题http://www.mylesgray.com:8080/
- >http://www.mylesgray.com/
。是什么导致这301重定向?
这里是我的Nginx default
和fastcgi_params
配置文件:
https://gist.github.com/1745271
https://gist.github.com/1745313
这是相当因为我试图运行Nginx的基准W /缓存 VS 一个nusance使用Nginx顶部的清漆进行清漆,查看是否有任何性能优势。
因此我直Nginx的W /缓存侦听端口8080
和端口80
清漆转发上localhost:8080
任何非缓存请求,Nginx的,所以很明显我想要做的是http://www.mylesgray.com:8080/
和运行ab
基准http://www.mylesgray.com/
看到区别。
以下是各种地址的curl -I
的结果。
# 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/
然后运行curl -I http://www.mylesgray.com
给出:
# 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
因此,大家可以看到80
由清漆和8080
送达Nginx的,但我不能找到任何地方什么,做了301重定向,而不是在nginx.conf
或在sites-enabled/default
文件中,我不相信它是由Wordpress本身引起的,但是非常容易修正。
请帮忙,这让我疯狂!
迈尔斯
我已经加入这个我'的/ etc/nginx的/ fastcgi_params'并重新启动所有服务,但卷曲仍表现出不同的'HTTP 301的所有:// www.mylesgray.com'。 – 2012-02-05 12:35:46
这是我的'默认'网站conf和我的'fastcgi_params'文件分别是:https://gist.github.com/1745271和https://gist.github.com/1745313 – 2012-02-05 12:41:15
您运行的是哪个版本的nginx?看来,覆盖fastcgi_param的请求头直到0.8.40才被添加。 – kolbyjack 2012-02-06 12:27:01