输入domain.top
可以跳转到https://domain.top
但是输入www.domain.top
却跳转不到https://domain.top
怎么办?这个应该怎么配置呢?
就是想统一跳转到https://domain.top
server{
listen 80;
server_name www.domain.top domain.top;
return 301 https://domain.top$uri;
}
server {
listen 443 ssl;
server_name domain.top;
client_max_body_size 20M;
ssl on;
ssl_certificate /etc/nginx/ssl/1_domain.top_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/2_domain.top.key;
set $root_path '/var/www/html/domain';
root $root_path;
index index.php index.html index.htm;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…