【Linux专题】同个ip同个服务器搭建多个站点https
  gfZJGExlM4kK 2023年11月24日 42 0

原创: 厦门微思网络

Nginx 配置文件多站点https

【Linux专题】同个ip同个服务器搭建多个站点https_同个ip同个服务器搭建多个站点https

配置文件如下:

worker_processes 4;
events {
    worker_connections 100000;
}

http {
    include mime.types;
  default_type application/octet-stream;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    client_max_body_size 512M;

    server {
        listen 80;
        server_name tjh8898.com www.tjh8898.com;
        rewrite ^(.*)$ https://$host$1 permanent;
    }

    server {
        server_name tc88988.com www.tc88988.com;
        #root /usr/local/nginx/html2;
        rewrite ^(.*)$ https://$host$1 permanent;
    }

    server {
        listen 443 ssl ;
        server_name tjh8898.com www.tjh8898.com;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
        ssl_certificate "/usr/local/nginx/ssl/fullchain.cer";
        ssl_certificate_key "/usr/local/nginx/ssl/tjh8898.com.key";
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout 10m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;

        location / {
            index index.php index.html index.htm;
        }

    error_page 404 /404.html;

    location = /40x.html {

    }

    error_page 500 502 503 504 /50x.html;

    location = /50x.html {

        }
    }

  server {
    listen 443 ssl ;
    server_name tc88988.com www.tc88988.com;
    root /usr/local/nginx/html2;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    ssl_certificate "/usr/local/nginx/ssl2/fullchain.cer";
    ssl_certificate_key "/usr/local/nginx/ssl2/tc88988.com.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
      index index.php index.html index.htm;
    }

    error_page 404 /404.html;

    location = /40x.html {

    }

    error_page 500 502 503 504 /50x.html;

    location = /50x.html {

    }
  }
}


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

上一篇: categraf托管与自升级 下一篇: http2
  1. 分享:
最后一次编辑于 2023年11月24日 0

暂无评论

推荐阅读
  6YY0QMPUXEwu   2023年12月10日   28   0   0 linux网卡
  jnZtF7Co41Wg   2023年12月11日   27   0   0 nginx客户端服务端
  nIt0XG0acU8j   2023年12月11日   29   0   0 linuxhtop
  jnZtF7Co41Wg   2023年12月10日   20   0   0 nginx客户端服务端NFS
  nIt0XG0acU8j   2023年12月09日   33   0   0 linuxsort
gfZJGExlM4kK