我试图只为我的站点的"API“子域设置SSL,下面是我的SSL配置:
# HTTPS server
server {
listen 443;
server_name api.example.com;
ssl on;
ssl_certificate /some_path/to/server.crt;
ssl_certificate_key /some_path/to/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://site;
}
}然而,Nginx似乎也允许我连接到https://example.com。火狐将要求我确认相同的证书(由我自己签名)。
我认为使用server_name指令只会将SSL限制在该子域,但现在它也允许对所有子域进行SSL请求。我是不是遗漏了什么?
发布于 2013-08-01 02:20:47
如果没有服务器名称指示,提供HTTPS内容的服务器就不知道所请求的域名是什么(因为Host头本身是加密的)。因此,对该IP的所有请求,无论域名如何,都将获得默认的SSL虚拟主机。
https://stackoverflow.com/questions/17984170
复制相似问题