在使用宝过程中遇到一个问题
例如我设置了https://www.a.com,我后来发现用没设置SSL的https://www.b.com也能访问,但是访问的页面是https://www.a.com的页面。
经过许多参考资料,现在给一个解决办法
server
{
listen 443;
listen [::]:443;
server_name xxx;
index index.php index.html index.htm default.php default.htm default.html;
root xxx;
ssl_certificate /www/server/panel/vhost/cert/xxx.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/xxx.com/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
rewrite ^(/.*)$ http://$host$1 permanent;
}
网站配置里面加上这个跳转