include conf.d/*.conf;
server {
listen 9999;
server_name 127.0.0.1;
location / {
root html;
index error.html;
}
}
server {
listen 80 default_server;
server_name _;
return 404;
error_page 403 404 500 502 503 504 http://error.test.com;
location = /error.html {
root html;
}
}
server {
listen 443 ssl default_server;
server_name _; #下划线匹配所有,上面都匹配不到
ssl_certificate /home/clouder/vs/program/nginx/conf/ssl_key/test.crt;
ssl_certificate_key /home/clouder/vs/program/nginx/conf/ssl_key/test.key;
return 404;
error_page 403 404 500 502 503 504 https://error.test.com;
location = /error.html {
root html;
}