nginx version
nginx version: nginx/1.10.2
It has been implemented that http://(www).airknow.com jumps to https://www.airknow.com, but https://airknow.com cannot be implemented to jump to https://www.airknow .com How to modify the configuration
The following is my configuration
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;
#...
}
When writing a 443 port, I solved it like this. Two 80 ports can be merged into one server_name www.xxx.com xxx.com
I tried adding a new server between the second server and the third server above
After restarting, the https://airknow.com website cannot be accessed.
Same question as yours, found the answer
Like the above, add default_server ssl after 443 of the third server. I don’t know if there will be any negative effects