Skip to navigationSkip to main contentSkip to footerScaleway DocsSparklesIconAsk our AI
SparklesIconAsk our AI

Serverless Containers HTTP headers reference

Scaleway Serverless Containers automatically inject several HTTP headers into every incoming request. These headers provide metadata about the request, the client, and the routing path through the Scaleway infrastructure.

You can use these headers within your container logic for logging, security, and request tracing.

Injected headers reference

The following headers are available in the request object of your container.

HeaderDescription
X-Forwarded-ForA standard header used to identify the originating IP address of a client connecting through an HTTP proxy or load balancer.
X-Forwarded-ProtoIndicates the protocol (HTTP or HTTPS) used by the client to connect to the container.
X-Request-IDA unique string assigned to each incoming request to facilitate tracing and debugging.

Alongside those headers, the following headers are set for internal purpose. Users should be careful when using them, as their presence/contents is not guaranteed:

HeaderDescription
X-Envoy-External-AddressInternal. The public IP address of the client, prefer using X-Forwarded-For.
K-Proxy-RequestInternal. Used by the underlying architecture.

Detailed use cases

Request tracing and debugging

The X-Request-ID header is essential for distributed tracing. Each request receives a unique identifier that persists throughout the lifecycle of the request within the Scaleway ecosystem.

  • Log correlation: Log the X-Request-ID at the start of your container. If a request fails, you can use this ID to search through your Serverless Containers logs to find all entries related to that specific execution. The request ID doesn't appear by default in users logs; if wanted, users have to propagate the header value themselves.
  • Cross-service tracking: If your container calls another service, pass the X-Request-ID along to maintain a consistent trace across your architecture.

Client IP identification

While X-Forwarded-For contains the list of IP addresses the request has passed through, X-Envoy-External-Address provides a reliable way to identify the entry point of the request.

  • Security and filtering: Use X-Envoy-External-Address to implement IP-based rate limiting or to allow/deny requests from specific geographic regions within your application logic.
  • Analytics: Use this address to determine the general location of your users without relying on the internal routing IPs.

Protocol enforcement

The X-Forwarded-Proto header allows your container to determine if the user is connecting over a secure connection.

  • HTTPS redirection: If your container logic requires a secure connection, you can check if X-Forwarded-Proto is http and respond with a redirect to the HTTPS version of your endpoint.
InformationOutlineIcon
Note

Because Scaleway Serverless Containers are served via HTTPS by default, this header usually reflects https for external requests.

SearchIcon
No Results