首页 » Linux » 阅读文章

nginx配置301重定向

2012-01-12 17:02 4770 0 发表评论
标签:

我的nginx配置方法是:

server
{
listen 80;
server_name www.jwzzsw.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.jwzzsw.com;

include discuz.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/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 off;
}

#下面这个就是要301重定向的域名

server {
server_name jwzzsw.com;
rewrite ^(.*)  http://www.jwzzsw.com/$1 permanent;
}

 

本文地址:http://www.jwzzsw.com/archives/1001.html

文章作者:思悟
版权所有 © 转载时请以链接形式注明作者和原始出处!

评论 共0条 (RSS 2.0) 发表评论

  1. 暂无评论,快抢沙发吧。

发表评论

联系我 Contact Me

回到页首