龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

nginx下不帶www跳轉(zhuǎn)到帶www

2015.09.10 | 1433閱讀 | 0條評(píng)論 | 通用代碼

server
{
listen 80;
server_name m.motherlaand.com 0597seo.com;
index index.php index.html index.htm;
root /home/wwwroot/0597seo.com;
include /home/wwwroot/0597seo.com/.htaccess;

if ($host != 'm.motherlaand.com') {
rewrite ^/(.*)$ http://m.motherlaand.com/$1 permanent;
}

location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "open_basedir=/home/wwwroot/0597seo.com/:/tmp/:/proc/";
include fastcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

location ~ /\.ht {
deny all;
}

}


贊 (

發(fā)表評(píng)論