nginx设置默认服务器

server {
    listen 80 default_server;
    server_name _;
    return 404;
}
server {
    server_name _;
    listen 443 ssl;
    ssl_certificate fullchain.pem;
    ssl_certificate_key privkey.pem;
    return 404;
}

nginx设置默认服务器

文档

  1. Properly setting up a “default” nginx server for https