1. Caddy version (caddy version
):
v2.4.3 xcaddy built from GitHub - mholt/caddy-l4: Layer 4 (TCP/UDP) app for Caddy
2. How I run Caddy:
caddy is running as a service on a vpc instance behind a load balancer that has passtrough.
I use json configuration with a apps > http > static_response handler for healthcheck beside the layer4 that I’m trying to configure
d. My complete Caddyfile or JSON config:
omitted logging and http app. since this is working fine.
"apps": {
"layer4": {
"servers": {
"server0": {
"listen": ["0.0.0.0:443"],
"routes": [
{
"handle": [
{
"handler": "proxy",
"upstreams": [
{"dial": ["myname.dhru3k.mongodb.net:27017"]}
]
}
]
}
]
}
}
}
}
3. The problem I’m having:
I don’t have access to port 27017 so I’m trying to use caddy as a proxy on port 443 so it redirects traffic to destination on port 27017.
The destination is a database url like so:
mongodb+srv://username:password@myname.dhru3k.mongodb.net/testing?somequery=true&otherquery=yep
[My Client] => [mydomain:443] => [mongodb.net:27017]
The client is complaining about resolving DNS, probably this “+srv”, so, before I go on, I would like to know if what I’m trying to achieve is possible with caddy.