Reverse Proxy with Dynamic DNS

Caddy Version: v2.4.6

How I run Caddy: With caddy reload? on Ubuntu server 20.04
I am editing and configuring caddy with this command:

 caddy reload --config /etc/caddy/Caddyfile

My complete Caddyfile or JSON config:
Testing

{
    auto_https off
}

http://localhost {
    reverse_proxy 192.168.1.11:80
}

Production

{
    auto_https off
}

http://subdomain.localhost {
    reverse_proxy 192.168.1.11:80
}

Currently, I am trying to use a dynamic dns, eg subdomain.ddns.net, and be able to host multiple services on my homelab at multiple subdomains such as service1.subdomain.ddns.net. I’m currently forwarding the 80 port directly to my Caddy vm. However, when I tried with the “testing” config file, I get an ERR_SSL_PROTOCOL_ERROR when typing in the domain of the caddy machine. The production config also doesn’t work. Currently, I’m trying with one service, hosted in the container 192.168.1.11 at port 80, Gitlab. Accessing directly at 192.168.1.11 works, but with caddy, it doesn’t work, even when I don’t have a subdomain.
Any idea why this setup isn’t working?
Apologies for the beginner/basic questions, I’m still new to setting up reverse proxies.

1 Like

Looks like you’re making an HTTPS request if you’re getting an SSL error code; your config only has Caddy listening for HTTP requests, so HTTPS won’t connect.

I’m not sure I understand what you’re trying to do, your paragraph explanation doesn’t really seem to match the Caddyfile config.

Please avoid saying “doesn’t work”; we need to know specifically what the symptoms are. How did you test it, and what was the result, exactly?

Try making requests with the curl -v command, which will show more details than trying with a browser.

1 Like

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