RT    由于要https 加了证书  nginx配置文件如下  请问我应该怎么配置 二级域名  
例如:我本身是www.abc.com   我现在要配 bbs.abc.com  配置文件该怎么实现?       server {
        listen 443;
        server_name gdchaben.cn;
        ssl on;
        root /var/www/;
        index index.html index.htm;
        ssl_certificate   cert/212592012570254.pem;
        ssl_certificate_key  cert/212592012570254.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        location / {
            root /var/www/app;
            index index.php index.html index.htm;            if (!-e $request_filename){
                rewrite  ^(.*)$  /index.php?s=$1  last;
                break;
            }
        }
        location ~ \.php$ {
            root           /var/www/;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/app$fastcgi_script_name;
            include        fastcgi_params;
        }    }

解决方案 »

  1.   

    首先你的证书得支持两个域名或以上,单域名证书是只能绑定一个域名的。然后把bbs.abc.com解析到你的服务器ip,然后复制上面的代码把server_name gdchaben.cn;改成server_name bbs.abc.com;  root /var/www/;改成bbs的项目路径
      

  2.   

    1、解析二级域名,去域名管理服务商网站添加解析
    2、添加一份nginx 的*.conf 文件,修改bbs的server_name 和根目录 root 
    3、重启nginx