启用 nginx 默认的 https 站点

就得有个证书

然后就有一个 假证书

https://serverfault.com/a/846214/477852

1
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./default.key -out ./default.crt
1
2
3
4
5
6
7
8
9
10
11
server {
listen 80;
listen [::]:80;
listen 443 ssl default_server;
ssl_certificate /usr/local/nginx/conf/ssl/default.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/default.key;
server_name _;
access_log /data/wwwlogs/default.log;
index index.html;
root /usr/local/nginx/html;
}

然后 只要是 https 协议 没有匹配到站点的话 都会来到这里