Goal
Make logs, rate limits and allow-lists in your app see the real client address.Prerequisites
- A domain added in Networking.
Workflow
1
With StackShift handles HTTPS, or on port 80, read X-Forwarded-For. Nothing to turn on.
2
With Forward HTTPS untouched, configure your web server to accept the PROXY protocol on port 443.
3
Then edit the domain in Networking and turn on Pass the visitor’s real IP.
What each mode sends
- StackShift handles HTTPS: plain HTTP to your App port with X-Forwarded-For, X-Forwarded-Proto: https and X-Forwarded-Host.
- Forward HTTPS untouched, port 80: X-Forwarded-For and X-Forwarded-Proto: http.
- Forward HTTPS untouched, port 443: the encrypted connection is not opened, so no header can be added. With Pass the visitor’s real IP on, each connection starts with a PROXY protocol version 2 header that carries the visitor’s address.
- With HTTPS forwarded untouched, IPv6 visitors reach the server directly through the AAAA record, so their own address is the client address and no header is added. With StackShift handling HTTPS, IPv6 visitors go through the edge like IPv4 visitors and arrive with X-Forwarded-For.
Turn the PROXY protocol on in the right order
A web server that does not expect the PROXY header fails every HTTPS request when the header arrives, and one that requires it fails when it is missing. Configure the web server first, then turn on Pass the visitor’s real IP. The switch is offered only for Forward HTTPS untouched. Trust the forwarded address only from the StackShift edge, never from the whole internet. Edge connections reach your server over IPv6 from the machine it runs on. Networking shows that address under the PROXY switch and the App port as the only one to trust; allow only it.nginx
Caddyfile
Traefik static configuration
Apps behind StackShift handles HTTPS
Frameworks read the client IP from X-Forwarded-For only when the proxy is trusted. For example, set trust proxy in Express, TrustProxies in Laravel, or —forwarded-allow-ips in Gunicorn and Uvicorn.Expected result
Your access logs show the visitor’s address instead of the StackShift edge.
Common failures
Related guides
Domains and HTTPS
Point your own domain at a VPS, prove it with a TXT record, and choose per domain whether StackShift handles HTTPS or forwards it untouched.
Use a VPS with Coolify or Dokploy
Install Coolify or Dokploy at order time, forward HTTPS untouched to its proxy, and use the server’s wildcard name or your own domains for apps.