# Tx OS — Caddy reverse proxy in HTTPS_MODE=skip (developer-only).
#
# Serves plaintext HTTP on :80 with NO certificate requirement. Used
# by start.sh on hosts that don't have mkcert / a real cert yet so
# the operator can still reach the app and run the first-time wizard.
# Never enable this in production.

{
	auto_https disable_certs
	admin off
}

(api_proxy) {
	@websocket {
		header Connection *Upgrade*
		header Upgrade websocket
	}
	reverse_proxy /api/socket.io/* api:8080
	reverse_proxy /api/* api:8080
}

(spa_proxy) {
	reverse_proxy web:80
}

:80 {
	encode zstd gzip
	import api_proxy
	import spa_proxy
}
