我有一台装有负载均衡器的机器,容器中装有nginx,我想通过443将2个域重定向到一台服务器,这可行。 但是当我添加带有子域的服务器c作为ssl_preread_server_name时 它不起作用。 (第一个仍在工作)
我尝试使用正则表达式,进行了搜索,但没有找到与ssl_preread和子域相关的任何内容
map $ssl_preread_server_name $name {
*.my.domain.com c;
a.another.domain.com a;
b.another.domain.com b;
}
upstream a {
server "ip1:443" max_fails=2 fail_timeout=30s;
}
upstream b {
server "ip1:443" max_fails=2 fail_timeout=30s;
}
upstream c {
server "ip2:33390" max_fails=2 fail_timeout=30s;
}
log_format stream_routing '$remote_addr [$time_local] '
'with SNI name "$ssl_preread_server_name" '
'proxying to "$name" '
'$protocol $status $bytes_sent $bytes_received '
'$session_time';
server {
listen 443;
ssl_preread on;
proxy_pass $name;
access_log /var/log/nginx/stream_443.log stream_routing;
}
当我添加带有子域的服务器c作为ssl_preread_server_name时
错误是:
*3 no host in upstream ""
当我卷曲服务器时,应将其重定向到上游c