问题原文
原帖链接 · user319862 · CC BY-SA 3.0
I need to serve several applications over https using one external ip address.
The ssl certificates should not be managed on the reverse proxy. They are installed on the application servers.
Can a reverse proxy be configured to use SNI and pass ssl through for termination at the endpoint?
Is this possible using something like Nginx or Apache? What does the configuration look like?
已采纳解答
原帖链接 · Florin Asăvoaie · CC BY-SA 3.0
This IS possible with Haproxy. You can setup a TCP proxy and extract the SNI and do routing based on the SNI. Here's an example:
backend be.app1
mode tcp
no option checkcache
no option httpclose
tcp-request inspect-delay 5s
tcp-request content accept if { req.ssl_hello_type 1 }
tcp-request content reject
use-server server1 if { req.ssl_sni -m beg app1. }
server server1 server1:8443 check id 1 weight 0
It is essential to delay the request until you get the SSL hello, otherwise haproxy will try to make a connection before receiving the SNI header.
I am using servers with weight 0 because, in my current configuration, I only have one server running for each SNI and I don't want them to receive random requests. You can probably find better ways to play with this.
I hope this helps.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
