配置
# nginx.conf
include sites-enabled/*
# sites-enabled/any.conf
server {
listen 80;
listen 443 ssl http2;
server_name *.a.b.com;
ssl_certificate certs/any.a.b.com.pem;
ssl_certificate_key certs/any.a.b.com.key;
}
# sites-enabled/be_default.conf
server {
listen 80;
listen 443 ssl http2;
server_name _;
ssl_certificate certs/$ssl_server_name.pem;
ssl_certificate_key certs/$ssl_server_name.key;
}
使用命令curl -v --resolve 'c.com:443:127.0.0.1' -H "Host: c.com" https://c.com
根据 error 日志看,却进到了 *.a.b.com
.... server:*.a.b.com request_uri:/ ...
按理说 any.conf 的 server_name 根本匹配不到 c.com 才对。应该走 be_default.conf 。不明所以。
1
q1angch0u 2022-09-07 00:17:35 +08:00 via iPhone
|