Reverse proxy to domain keeps loading

1. Caddy version (caddy version):


2. How I run Caddy:

I run Caddy inside a docker container on a VM

a. System environment:

Docker 20.10.10 running on Ubuntu 20

b. Command:

I use the Docker container

c. Service/unit/compose file:

version: "3.7"

    container_name: caddy
    build: .
    restart: always
      - "80:80"
      - "443:443"
      - $PWD/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

    external: true

d. My complete Caddyfile or JSON config: {
	reverse_proxy http://<my-server-ip>:3000
} {

3. The problem I’m having:

My DNS record for points to my-server-ip. Opening this domain directly works just fine. I also have a CNAME record pointing to, opening this in my browser shows nothing and the loading icon of the browser keeps spinning. I know I can just use my-server-ip directly in the reverse-proxy directive for but I want to have several of these pointing to and only have to change my ip in one place and while showing showing in the address bar.

4. Error messages and/or full log output:

No errors other than the browser loading

5. What I already tried:

I tried rewriting the Host header but that changes the URL in the address bar to I want the address bar to still show

6. Links to relevant resources:

You could just do this, I think, if it’s what I think you’re trying to do:, {
	reverse_proxy http://<my-server-ip>:3000

Much simpler than trying to chain them together.

1 Like

I believe the reverse_proxy line could even just be reverse_proxy <my-server-ip>:3000 since HTTP is the default for upstreams. :+1: