鍍金池/ 問答/PHP  Linux/ nginx服務(wù)器,怎么配置一個(gè)主網(wǎng)站用https訪問,一個(gè)論壇用二級域名http

nginx服務(wù)器,怎么配置一個(gè)主網(wǎng)站用https訪問,一個(gè)論壇用二級域名http訪問?

問題:eloading nginx!nginx: [warn] conflicting server name "bbs.*.com" on 0.0.0.0:80, ignored
配置了主域名的https訪問,怎么再去實(shí)現(xiàn)二級域名的http訪問
主網(wǎng)站配置https如下:

server {
    listen 80;
    server_name www.***.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen       443 ssl;
    server_name  www.***.com;
    
    ssl on;
    index index.html index.htm index.php;
    root /www/default;
    ssl_certificate /alidata/server/nginx/conf/ssl/cert_bundle.crt;
    ssl_certificate_key /alidata/server/nginx/conf/ssl/server.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";

    ssl_session_cache builtin:1000 shared:SSL:10m;
    ssl_dhparam /alidata/server/nginx/conf/ssl/certs/dhparam.pem;
    location ~ .*\.(php|php5)?$
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
}

論壇http配置如下:

server {
    listen 80;
    server_name bbs.***.com;
    index index.html index.htm index.php;
    root /www/default/bbs;

    location ~ .*\.(php|php5)?$
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }

    access_log /alidata/log/nginx/access/bbs.log;
}

要怎么配置才能保證兩個(gè)都網(wǎng)站正常訪問?

回答
編輯回答
誮惜顏

合并一下不行?

2017年2月1日 05:39
編輯回答
大濕胸

開啟ssl又不需要寫兩個(gè)server

2017年9月18日 23:50