码迷,mamicode.com
首页 > 其他好文 > 详细

nginx配置域名跳转

时间:2018-09-20 18:50:39      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:配置域名   rman   fastcgi   param   code   pre   list   href   com   

nginx 配置主域名 xxx.com, 跳转子域名 www.xxx.com

server {
listen 80;
server_name www.xxx.com;

    location / {
        root   html/www/public_html;
        index  index.php index.html index.htm;
    }

    error_page  404              /404.html;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html/www/public_html;
    }

    location ~ \.php$ {
        root           html/www/public_html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
       #  fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #  include        fastcgi_params;**
        include        fastcgi.conf;
    }

}

#xxx.com --> www.xxx.com
server {
server_name xxx.com;
rewrite ^(.*)$ http://www.xxx.com$1 permanent;
}

nginx配置域名跳转

标签:配置域名   rman   fastcgi   param   code   pre   list   href   com   

原文地址:http://blog.51cto.com/23426820/2177818

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!