diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/proxy/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/proxy/run index 06ecf80c..e7cb1b1a 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/proxy/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/proxy/run @@ -31,6 +31,13 @@ if bashio::var.true "$(bashio::core.ssl)"; then bashio::exit.nok fi +# Test Home Assistant's HTTP reverse proxy configuration +if (( 200 != $(curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:$(bashio::core.port)" -H "X-Forwarded-For: 127.0.0.1") )); then + bashio::log.error "Unable to connect to Home Assistant on http://127.0.0.1:$(bashio::core.port)" + bashio::log.error "Please check your configuration based on the add-on's Documentation under \"Option: proxy\"" + bashio::exit.nok +fi + # Set up proxy # Note: Configuration is persistent between reboots, though configuring the same value won't cause duplicate entries, # but will overwite previous entry if core.port has been changed