Skip to content

Instantly share code, notes, and snippets.

@agbaraka
Last active July 9, 2023 08:04
Show Gist options
  • Save agbaraka/311d39ae37c48e2d049e4d16204234aa to your computer and use it in GitHub Desktop.
Save agbaraka/311d39ae37c48e2d049e4d16204234aa to your computer and use it in GitHub Desktop.
Caddy server v2: reverse proxy config json for multiple virtual hosts
{
"apps": {
"http": {
"servers": {
"example": {
"listen": ["127.0.0.1:80"],
"routes": [
{
"match":[{"host":["a.myhost.com"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"host": "http://localhost:8080"
}
]
}
]
},
{
"match":[{"host":["b.myhost.com"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"host": "http://localhost:3000"
}
]
}
]
}
],
"automatic_https":{
"disable": true
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment