Normalmente, em tais frontends, você instala o tráfego SSL no frontend e encaminha para o backend o tráfego HTTP normal sem criptografia.
https http Internet --------> relayd reverse proxy -------> internal LAN web server port 443 port 80
Como em man relayd
:
The following configuration would add a relay to forward secure HTTPS connections to a pool of HTTP webservers using the loadbalance mode (TLS acceleration and layer 7 load balancing). The HTTP protocol definition will add two HTTP headers containing address information of the client and the server, set the “Keep-Alive” header value to the configured session timeout, and include the “sessid” variable in the hash to calculate the target host:
http protocol "https" {
match header set "X-Forwarded-For" \
value "$REMOTE_ADDR"
match header set "X-Forwarded-By" \
value "$SERVER_ADDR:$SERVER_PORT"
match header set "Keep-Alive" value "$TIMEOUT"match query hash "sessid"
match hash "sessid"pass
block path "/cgi-bin/index.cgi" value "command="tls { no tlsv1.0, ciphers "HIGH" }
}relay "tlsaccel" {
listen on www.example.com port 443 tls
protocol "https"
forward to port 8080 mode loadbalance check tcp
}
Se o ssl
ou tls key
estiver presente, ele tentará localizar os arquivos de acordo com o endereço IP ao qual o vhost está associado. Quanto aos certificados X.509, relayd
tentará encontrá-los em /etc/ssl/private
para a chave privada e /etc/ssl
para a (s) chave (s) pública (s) do certificado.
If the ssl keyword is present, like in our line "listen on $relayd_addr port $relayd_port ssl", the relay will accept connections using the encrypted SSL protocol. The relay will look up a private key in /etc/ssl/private/address.key and a public certificate in /etc/ssl/address.crt, where address is the specified IP address of the relay to listen on.
So, the name of the files must be the same as the address relayd is listening on. In our example relayd.conf, we are listening on "relayd_addr=127.0.0.1" so our files MUST be named 127.0.0.1.key, 127.0.0.1.csr and 127.0.0.1.crt.
Para servir a porta 80, basta adicionar a sintaxe normal como um proxy HTTP à configuração acima. Ambos podem coexistir ao mesmo tempo.