Common headers
Don’t use the address of the TCP connection as the visitor’s IP: it’s Sevalla’s ingress. Configure your framework to trust the ingress, so that
request.secure and generated URLs are right. See Trust the ingress proxy.
Headers Cloudflare adds
Every request to the application’s domains passes through Cloudflare, in every location.
Cloudflare also passes on the visitor’s own headers, such as
User-Agent, Accept, Accept-Language, Cookie and Referer.
Headers the ingress adds
After Cloudflare, Sevalla’s ingress in the application’s location routes the request to the web process, addsX-Request-Id when the request has none, and adds headers starting with X-Envoy-. It also:
- Replaces
X-Forwarded-Protowith the protocol the request used, so a value the visitor sends never reaches the application. - Adds Cloudflare’s address to the end of
X-Forwarded-For. With hibernation on, the address of Sevalla’s ingress follows it. - Never sets
X-Forwarded-HostorX-Forwarded-Portto a value you can rely on: whatever the visitor sends reaches the application. With hibernation on,X-Forwarded-Hostis always present and usually matchesHost, but a visitor can still set it.
x-svl-origin-port. Don’t build on them: they can change without notice. Rely on the headers in Common headers, which are the same in every location.
Trust the ingress proxy
The web process receives each request from Sevalla’s ingress, not from the visitor. Frameworks readX-Forwarded-Proto and X-Forwarded-For only from proxies they trust, so tell yours which addresses the ingress connects from.
- Trust
10.244.0.0/16. The ingress runs as several instances that connect from addresses in the location’s pod network,10.244.0.0/16, which is the same in every location. Instances are added, removed and replaced as traffic changes and during maintenance, and each new one gets a new address, so don’t trust single addresses you saw in your logs. - Don’t trust every hop. With a setting that trusts every proxy in
X-Forwarded-For, such asapp.set("trust proxy", true)in Express, the framework returns the first address in it, which the visitor sets.
Before the move to OCI, requests came from a proxy inside the application’s pod, at
127.0.0.6. An application that trusts only 127.0.0.6 or 127.0.0.1 now ignores the proxy headers: it generates http:// URLs for assets and forms on HTTPS pages, or redirects in a loop.
Applications that Ingot builds for PHP, .NET and Python (with Gunicorn, Uvicorn or Daphne) read these headers already. You set this up yourself with your own Dockerfile, or for frameworks that don’t do it by default.
In Laravel 11 and later, trust the ingress in bootstrap/app.php:
bootstrap/app.php
App\Http\Middleware\TrustProxies: $proxies = '10.244.0.0/16' and $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PROTO.
In Express, trust the ingress by address:
server.js
X-Forwarded-Host for req.hostname, so take the domain from req.get("host") instead.
With either, generated URLs use https:// and the domain from Host, with no port. $request->ip() and req.ip return Cloudflare’s address: read CF-Connecting-IP for the visitor’s address. On a PHP application that Ingot builds, $request->ip() already returns the visitor’s address.
Headers Sevalla adds to responses
Sevalla doesn’t change the other headers your application sends.
See the headers your application receives
The headers a request carries are visible only to the application. To list them, log them from your code, for example with a temporary route in a Node.js application:server.js
https://shop.example.com/debug/headers, read the result or the runtime logs, and remove the route afterwards: it shows request details to anyone who opens it. To see response headers, run curl -I https://shop.example.com.