Relayd

1- doas nano /etc/relayd.conf

ip4="38.87.162.30"
ip6="2602:fccf:1:1030::"
table <www> { 127.0.0.1 }
table <bnc> { 127.0.0.1 }
log connection
http protocol https {

        match request header append "X-Forwarded-For" value "$REMOTE_ADDR"
match request header append "X-Forwarded-By" \
value "$SERVER_ADDR:$SERVER_PORT"
match request header set "Connection" value "close"
tcp { sack, backlog 128 }
tls { keypair domain-name }
match request header "Host" value "domain-name" forward to <www>
match request header "Host" value "bnc.domain-name" forward to <bnc>
}
relay wwwtls { listen on $ip4 port 443 tls protocol https forward to <www> port 80 check icmp forward to <bnc> port 1338 check icmp

}
relay www6tls {

        listen on $ip6 port 443 tls
        protocol https
        forward to <www> port 80 check icmp
        forward to <bnc> port 1338 check icmp

}

2- doas rm /etc/login.conf.db
3- doas pfctl -e
4- Starting relayd
$ doas rcctl enable relayd
$ doas rcctl start relayd
5- debug on fail:
$ doas rcctl stop relayd
$ doas relayd -dvv