Reverse proxy Ethereum RPCPort through a domain name

How to reverse proxy EthereumRPCPort through a domain name?

1. Caddy version (caddy version):

last version (2.3.0)

2. How I run Caddy:

Ubuntu apt install caddy, caddy run

a. System environment:

Ubuntu 18.04

b. Command:


c. Service/unit/compose file:


d. My complete Caddyfile or JSON config:

http://domain{
        reverse_proxy localhost:22003  //22003 is ethereum RPC port
}

3. The problem I’m having:

I can pass the IP + Port to the Ethereum Node, but after opening the reverse agent, it failed through domain name.

4. Error messages and/or full log output:

When I access the domain name through the browser, it returns “Invalid Host Specified”

5. What I already tried:

6. Links to relevant resources:

Please upgrade to v2.4.6! You’re using an old version.

You should be running it as a systemd service, there’s a bunch of advantages. If you installed it with apt, then it should already be set up that way.

Make sure to have a space between your domain and {, it’s important, other wise the Caddyfile parser will not accept the domain.

Check your logs, there might be an error message about this.

Is that an HTTP server? Or is it some non-HTTP protocol? Caddy’s built-in reverse_proxy can only proxy HTTP and websocket traffic.

What’s in Caddy’s logs? See the page in the docs linked above, it shows you how to find your logs when running as a service.

This topic was automatically closed after 30 days. New replies are no longer allowed.