On Sun, Oct 25, 2015 at 7:30 PM, Hiltjo Posthuma <hil...@codemadness.org>
wrote:
> My /etc/relayd.conf looked something like this:
>
>     table <service> { 127.0.0.1 }
>
>     http protocol "protmyapp" {
>             return error
>
>         # TODO: forward non-matching traffic to standard httpd.
>             match request header "Host" value "someapp.mydomain.*"
>     }
>
>     relay "myapp" {
>             listen on 0.0.0.0 port 80
>             protocol "protmyapp"
>             forward to <service> port 8081
>     }
>

I figured it out, I overlooked in relayd.conf(5) FILTER RULES:

"forward to ⟨table⟩ Forward the request to a server in the specified
table. With this option, requests can be passed to specific backend
servers. -> A corresponding forward to declaration in the RELAYS
section is required. <-".

In case someone wants to do a similar thing the working relayd.conf is
(simplified):

table <service> { 127.0.0.1 }
table <someappservice> { 127.0.0.1 }

http protocol "protsomeapp" {
    match request quick header "Host" value "someapp.mydomain.*" \
        forward to <someappservice>
}

relay "someapp" {
    listen on 0.0.0.0 port 80
    protocol "protsomeapp"

    forward to <service> port 8080
    forward to <someappservice> port 8081
}

Kind regards / hope this helps someone,
Hiltjo

Reply via email to