做301后出现的conflicting server name错误
之前运行正常,后来加了301设置,就是把 taaa.com转到了www.taaa.com ,不知道是不是设置的有问题,error.log中会出现下面的错误,但能正常跳转。请高手指点一下,谢谢!error.log 错误提示:
18540#0: conflicting server name "www.taaa.com" on 0.0.0.0:80, ignored
下面是全部的主机conf文件。
server
{
listen 80;
server_name www.taaa.com taaa.com;
if ($host != 'www.taaa.com' ) {
rewrite ^/(.*)$ http://www.taaa.com/$1 permanent;
}
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/www.taaa.com;
include discuzx.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/taaa.log;
error_page 404 /404.html;
} 这个域名添加了2次。 知道提示域名重复,请问该怎么修改呢? 把重复的删了就行了 大哥啊,关键是不知道哪一句是重复的啊。:Q
删的不对重启马上停机,所有网站都打不开。 添加了2次虚拟主机!找到多添加的配置文件删了就行了 好像不是添加了虚拟主机的问题。虚拟主机同域名的没有的。
是因为更改了这个conf文件,做了301转向,马上就出现这样的错误。两个不同的虚拟主机都是这样。 改成这样试试?
if ($host = 'taaa.com' ) {
rewrite ^/(.*)$ http://www.taaa.com/$1
页:
[1]