• 本帖最后由 akige 于 2018-5-1 21:20 编辑 *

配置如下 ssl的就不放出来了。没问题。
这样写看着没错啊?,就是跳不过去。

server {
listen 80;
server_name aaa.com;
return 301 https://www.aaa.com$request_uri;
}

server {
listen 80;
server_name www.aaa.com;

return 301 https://www.aaa.com$request_uri;
}

server {
listen 443;
server_name aaa.com;
return 301 https://www.aaa.com$request_uri;
}

我的需求就是

  1. xxx.com/a.html 跳到 https://www.xxx.com/a.html
  1. www.xxx.com/a.html 跳到 https://www.xxx.com/a.html
  1. https://xxx.com/a.html 跳到 https://www.xxx.com/a.html

完事。