Hi everyone,
Pardon if this is in the wrong section…
I have a separate linux VM running MQTT broker and Caddy as a reverse proxy for HA (running hassio VM). I’m running into a strange issue the reverse proxy seems to be redirecting to HA. All I get is the top header blue bar and nothing else. I’ve followed the steps in this link Reverse Proxy with Caddy to set up the reverse proxy. Syntax for Caddyfile is a little different as I installed caddy2, but the config per the link is just websocket and transparent mode, which is supposed to be the default for caddy2. I went ahead and added the below config to the Caddyfile to test, but still get this issue.
Here is what I have added to test it, as apparently the transparent keyword adds this to caddy v1, but didn’t work
header_upstream Host {host}
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream X-Forwarded-Port {server_port}
header_upstream X-Forwarded-Proto {scheme}
I’ve tried various things, including removing HTTPS config from the passthrough proxy and HA. Watching the Caddy process (–watch) doesn’t output any errors at all. I’m thinking this may be on some kind of trust issue with HA, but I’ve got the trusted proxy set up, too. At a loss here for a couple of days. HA’s been completely rebooted, proxy has too (for other things)
I’m a network engineer by trade, so tech isn’t foreign, but webservers aren’t exactly my strength
Before I scrap this and move to nginx, has anyone run into this and can provide a little guidance?
Thanks in advance!
Robert
Here is what I get in browser (regular, incognito, etc) no matter what I do (short of removing the reverse proxy config entirely or borking it intentionally)
Here is my current Caddyfile
domain.com {
root * /usr/share/caddy
file_server
}
domain2.com {
reverse_proxy / {
to 192.168.5.49:8123
# transport http {
# tls_insecure_skip_verify
# tls
# }
}
}
Current http section of config.yaml as you can see, I removed https for testing purposes
http:
#ssl_certificate: /ssl/fullchain.pem
#ssl_key: /ssl/privkey.pem
base_url: http://domain2.com
use_x_forwarded_for: true
trusted_proxies: 192.168.5.40
Browsing directly to the IP/port is fine over http (or when enabled, https)