Route IPv4 and IPv6 from VPS to local services

1. The problem I’m having:

I don’t know how I would setup a connection to my local services from my VPS over the internet so that the local services get the ip from my VPS.

2. Error messages and/or full log output:

.

3. Caddy version:

.

4. How I installed and ran Caddy:

.

a. System environment:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.23.6
PRETTY_NAME="Alpine Linux v3.23"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

docker info

Client:

Version: 29.5.2

Context: default

Debug Mode: false

Plugins:

buildx: Docker Buildx (Docker Inc.)

Version: v0.30.1

Path: /usr/libexec/docker/cli-plugins/docker-buildx

compose: Docker Compose (Docker Inc.)

Version: v2.40.3

Path: /usr/libexec/docker/cli-plugins/docker-compose

b. Command:

.

c. Service/unit/compose file:

.

d. My complete Caddy config:

.

5. Links to relevant resources:

.

I think there are two separate parts to this. Caddy can handle the incoming IPv4/IPv6 requests on your VPS, but it still needs a way to reach the services running on your local network.

If those services aren’t publicly reachable, something like a WireGuard tunnel between the VPS and your home server would make more sense than exposing each service directly. Caddy could then reverse proxy to the service’s address over that tunnel.

One thing I’m not quite sure about is what you mean by the services getting the VPS IP. Do you want visitors to connect through the VPS’s public IP, or do you want the backend services to see a particular client IP?

Those are slightly different setups, so it’d help to know which one you’re after.