1、修改原域名nginx配置
server {
listen 80 default;
server_name www.123abc.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/webname;
#通过$http_user_agent判断是否是百度蜘蛛
if ($http_user_agent ~* Baiduspider){
return 301 http://www.123abc.com $request_uri;
}
#排除对一个网址的301重定向
if ($request_uri !~ ^/.*/.*notify_url\.php.*){
return 301 https://$server_name$request_uri;
}
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
access_log /home/wwwlogs/www.123abc.com.log www.123abc.com;
}
server {
listen 443 ;
......
#https配置详见
}
2、修改新域名nginx配置
server
{
listen 80;
#listen [::]:80;
server_name