1. 设置域名解析
daijun.me 指向 234.33.22.21
2.主机234.33.22.21 nginx配置 转发
server { listen 80; server_name daijun.me www.daijun.me; access_log /data/wwwlogs/access_nginx.log combined; # root /data/wwwroot/default; # index index.html index.htm index.php; if ($host = 'daijun.me' ) { rewrite ^/(.*)$ http://www.cnblogs.com/wangdaijun/$1 permanent; } if ($host = 'www.daijun.me' ) { rewrite ^/(.*)$ http://www.cnblogs.com/wangdaijun/$1 permanent; }
}
location 语法规则http://www.cnblogs.com/lidabo/p/4169396.html
http://wiki.nginx.org/NginxHttpCoreModule#location
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:nginx 配置301转发 - Python技术站