server { listen 80; server_name domain www.domain; index index.html index.php; root /home/web/www/dede/www.domain; if (!-f $request_filename) { rewrite ^/list-([0-9]+)\.html$ /plus/list.php?tid=$1 last; rewrite ^/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3 last; rewrite ^/arc-([0-9]+)-1\.html$ /plus/view.php?arcID=$1 last; rewrite ^/arc-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2 last; rewrite ^(.*)/tags\.html /tags.php; rewrite ^(.*)/tags/(.*).html $1/tags.php?/$2; } location ~* ^/data/.*\.(php|php5)$ { deny all; } location ~* ^/templets/.*\.(php|php5)$ { deny all; } location ~ .*\.(php|php5)?$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.html; include fastcgi.conf; } if ($host != 'www.domain' ) { rewrite ^/(.*)$ http://www.domain/$1 permanent; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } error_page 404 /404.html; error_page 404 = http://www.domain/404.html; }
名字保存成 dede.com.conf 放在 /usr/local/nginx/conf/vhost/dede.com.conf
具体命令:
rm -Rf /usr/local/mysql/var/www_ABC_com
rm -Rf /home/web/www/dede/www.ABC.com
unzip www.ABC.com.zip
chmod -R 777 www.ABC.com
chown -R www:www www.ABC.com
\cp /usr/local/nginx/conf/vhost/dede.com.conf /usr/local/nginx/conf/vhost/www.ABC.com.conf
sed -i 's#domain#ABC.com#' /usr/local/nginx/conf/vhost/www.ABC.com.conf
sed -i 's#domain#ABC.com#' /usr/local/nginx/conf/vhost/www.ABC.com.conf
lnmp restart
发表评论