How to use caddy locally with multiple self hosted apps?

good day, I’m using below caddyfile

Caddyfile

https://127.0.0.1:2000

{
https_port 443
}

:443 {
tls internal {
on_demand
}

route /* {
	reverse_proxy 127.0.0.1:11234 # App port.
}

}

which will direct “localhost” to heimdall, how to add multiple port/apps?

Hi, welcome – have you tried the Caddyfile tutorial?

aight I tried to add multiple ports and sites but I couln’t ;-;

could you help pls, also I don’t really know how to code and such or how to use these bois {}

Have you read Caddyfile Concepts — Caddy Documentation as well?

The gist is, you need to use domains/subdomains for routing to different apps.

heimdall.example.com {
	reverse_proxy 127.0.0.1:11234
}

somethingelse.example.com {
	# do whatever
}
1 Like