原创: 厦门微思网络
Nginx 配置文件多站点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 {
}
}
}