need:
Two domain names want to point to the same website ip;
solve:
-
If you don't need https certificate access, you don't need to configure it. In the domain name resolution, you can add the same ip respectively, and map to the same website through dns resolution;
-
If you need https access, you need to configure port 443;
- First apply for an ssl certificate and select nginx deployment;
- Multiple domain names only need to add server configuration;
Add server configuration in http{};
original server
server {
listen 80 default_server;
server_name www.**.cn;
root /usr/share/nginx/html;
}
server {
#SSL 默认访问端口号为 443
listen 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