Reverse proxy returning 200 response but no content

Hey Brandon,

You will want to listen on 0.0.0.0 instead of localhost.

This didn’t change anything. I tried all the below.

I can see in the logs that caddy is getting the request with both localhost and 0.0.0.0. The issue is that the response from caddy isn’t returning the basic auth headers (or any content at all). The caddy logs show that http auth header is not being returned.

This works locally perfect, so it seems something here on render is confusing caddy.

http://localhost:{$PORT}

log
reverse_proxy 0.0.0.0:5555

basicauth {
  {$STUDIO_USERNAME} {$STUDIO_PASSWORD_HASH}
}
http://0.0.0.0:{$PORT}

log
reverse_proxy localhost:5555

basicauth {
  {$STUDIO_USERNAME} {$STUDIO_PASSWORD_HASH}
}
http://0.0.0.0:{$PORT}

log
reverse_proxy 0.0.0.0:5555

basicauth {
  {$STUDIO_USERNAME} {$STUDIO_PASSWORD_HASH}
}

Are you using the same version of Node locally and on Render?

Yes, I have 12.18 in .node-version

I got it working! Had to explicitly specify the domains

Caddyfile

{
  debug
  admin off
}

http://${RENDER_EXTERNAL_HOSTNAME},
http://mydomain.com {
  reverse_proxy 0.0.0.0:5555
  log
  basicauth {
    {$STUDIO_USERNAME} {$STUDIO_PASSWORD_HASH}
  }
}
1 Like