各种 Google 找不到答案,无奈只好请教一下大家。
先交代一下背景:
$ curl -I https://test.com/abc
HTTP/1.1 301 Moved Permanently
Date: Tue, 11 Dec 2018 11:48:50 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: http://test.com:443/abc/
http[80] => http[80]
https[443] => http[443]
server {
listen 80;
server_name test.com;
return 301 https://test.com$request_uri;
}
server {
listen 443 ssl;
server_name test.com;
ssl on;
ssl_certificate /etc/ssl/test.com.crt;
ssl_certificate_key /ect/ssl/test.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
index index.html;
root /data/web/test.com;
}