首页 » Linux » 阅读文章
nginx配置301重定向
标签:nginx
我的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;
}
评论 共0条 (RSS 2.0) 发表评论