< Nginx
Brucekomike(讨论 | 贡献) (创建页面,内容为“<syntaxhighlight lang="nginx"> stream{ upstream ssh { server 127.0.0.1:22; } upstream web { server 127.0.0.1:80; } map $ssl_server_name $srv_name { ~(.+)\.ssh ssh; default web; } server { listen port ssl; proxy_pass $srv_name; ssl_preread on; ssl_certificate /etc/letsencrypt/live/ossmedia.cn/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencry…”) |
Brucekomike(讨论 | 贡献) 无编辑摘要 |
||
第19行: | 第19行: | ||
ssl_certificate /etc/letsencrypt/live/ossmedia.cn/fullchain.pem; # managed by Certbot | ssl_certificate /etc/letsencrypt/live/ossmedia.cn/fullchain.pem; # managed by Certbot | ||
ssl_certificate_key /etc/letsencrypt/live/ossmedia.cn/privkey.pem; # managed by Certbot | ssl_certificate_key /etc/letsencrypt/live/ossmedia.cn/privkey.pem; # managed by Certbot | ||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="nginx"> | |||
stream{ | |||
upstream ssh { | |||
server 127.0.0.1:22; | |||
} | |||
upstream web { | |||
server 127.0.0.1:80; | |||
} | |||
map $ssl_preread_protocol $upstream { | |||
default web; | |||
"" ssh; | |||
"TLSv1.0" web; | |||
"TLSv1.1" web; | |||
"TLSv1.2" web; | |||
"TLSv1.3" web; | |||
} | |||
server { | |||
listen port; | |||
proxy_pass $upstream; | |||
ssl_preread on; | |||
} | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
2024年4月16日 (二) 10:06的最新版本
stream{
upstream ssh {
server 127.0.0.1:22;
}
upstream web {
server 127.0.0.1:80;
}
map $ssl_server_name $srv_name {
~(.+)\.ssh ssh;
default web;
}
server {
listen port ssl;
proxy_pass $srv_name;
ssl_preread on;
ssl_certificate /etc/letsencrypt/live/ossmedia.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ossmedia.cn/privkey.pem; # managed by Certbot
}
}
stream{
upstream ssh {
server 127.0.0.1:22;
}
upstream web {
server 127.0.0.1:80;
}
map $ssl_preread_protocol $upstream {
default web;
"" ssh;
"TLSv1.0" web;
"TLSv1.1" web;
"TLSv1.2" web;
"TLSv1.3" web;
}
server {
listen port;
proxy_pass $upstream;
ssl_preread on;
}
}