两个域名想指向同一个网站ip;
如果不需要https的证书访问,其实不需要配置,在域名解析中,分别添加同一个ip即可,通过dns解析,映射到同一个网站上;
如果需要https访问,就需要配置一下443端口了;
在http{}中新增server配置;
原有server
server {listen 80 default_server;server_name www.**.cn;root /usr/share/nginx/html;
}
server {#SSL 默认访问端口号为 443listen 443 ssl;server_name cloud.***.com; ssl_certificate cloud.***.com_bundle.crt; ssl_certificate_key cloud.***.com.key; ssl_session_timeout 5m;ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on;location / {root html; index index.htm