[root@test default]#cat default.conf server { listen 80 default_server; listen [::]:80 default_server; listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate ssl/default.com.pem; ssl_certificate_key ssl/default.com.key; server_name _; return 403; } default.com.pem default.com.key 这两个在网上找个在线生成自签证书即可。