nginx版本
nginx version: nginx/1.10.2
已经实现了http://(www).airknow.com 跳转到 https://www.airknow.com,但是无法实现https://airknow.com 跳转到https://www.airknow.com 该怎么修改配置
以下是我配置
server {
listen 80;
server_name airknow.com;
return 301 http://www.airknow.com$request_uri;
}
server {
listen 80;
server_name www.airknow.com;
return 301 https://www.airknow.com$request_uri;
}
server {
listen 443;
server_name www.airknow.com;
ssl on;
#...
}
跟你一样的问题,找到了答案
像上面这样,在第三个server的443后面加上default_server ssl,不知道会不会有什么负面影响