server {
listen 80 default_server;
# server_name ""; # Since version 0.8.48, this is the default setting for the server name, so the server_name "" can be omitted. In earlier versions, the machine’s hostname was used as a default server name.
return 444;
}
server {
listen 443 ssl default_server;
# server_name "";
ssl_certificate your_domain.com.pem; # 必须要设置一个证书,否则 nginx 会认为配置文件格式不正确,自签名的SSL证书也可以。
ssl_certificate_key your_domain.com.key;
return 444;
}