Wednesday, January 26, 2022

Relayd host address using DNS hostname

Hello!

I am trying to configure relayd with a relay using the DNS hostname in
the relay block. I have tried to follow relayd.conf(5) which states:

Within the sections, a host address can be specified by IPv4 address,
IPv6 address, interface name, interface group, or DNS hostname.

And also in the Examples I see:

relay "tlsaccel" {
listen on www.example.com port 443 tls
protocol "https"
forward to <phphosts> port 8080 mode loadbalance check tcp
}

I currently have a very similar configuration[1], but when using the DNS
hostname my server does not respond. However, when changing only the
relay block listen directive to the IP address the server responds as
expected.

Is there a configuration some place else that I did not discover?

Thank you,


Paul

[1] cat /etc/relayd.conf
log state changes
log connection errors
prefork 10

table <httpd> { 127.0.0.1 }

http protocol "www-httpd" {
return error
tcp { backlog 128 }

match request header set "X-Forwarded-For" value "$REMOTE_ADDR"
match request header set "X-Forwarded-Port" value "$REMOTE_PORT"
match request header set "X-Forwarded-By" value
"$SERVER_ADDR:$SERVER_PORT"
match request header set "Connection" value "keep-alive"

match request method GET tag ok
match request method HEAD tag ok

block
pass tagged ok
}

relay "httpd-www" {
listen on subdomain.example.com port 80
protocol "www-httpd"
forward to <httpd> port 8080
}

No comments:

Post a Comment