Skip to main content
This guide shows how to override the Host header when forwarding requests to an upstream backend using a Datum HTTPProxy. This is useful when:
  • The upstream expects a specific Host header
  • You are proxying to a shared or virtual-hosted service
  • The backend’s DNS name does not match the public hostname

Overview

At a high level, this setup:
  1. Accepts public traffic at a configured hostname
  2. Forwards all requests to an upstream backend
  3. Rewrites the Host header before the request reaches the upstream

Prerequisites

  • datumctl installed and authenticated
  • A valid Project

Configuration Steps

Step 1: Set Variables

Windows (PowerShell)

macOS / Linux


Step 2: Apply Host Header Configuration

The RequestHeaderModifier filter overwrites the Host header before the request is forwarded upstream. The type field is required.

Windows (PowerShell)

macOS / Linux


Verification

httpbin.org/headers echoes the request headers received by the upstream, making it easy to confirm the rewrite.
Look for Host in the response:
If Host shows example.internal, the rewrite is working correctly.

Cleanup

Windows (PowerShell)

macOS / Linux


Troubleshooting


Best Practices

  • Use set to overwrite the Host header — add appends to any existing value instead of replacing it
  • Keep the rewritten hostname consistent with what the upstream backend expects in its virtual host configuration
  • Test with httpbin.org/headers before pointing at a real upstream — it removes backend variables from the equation

Summary

  • Host header rewriting uses a RequestHeaderModifier filter on the rule’s filters list
  • The type: RequestHeaderModifier field is required — omitting it will cause the API to reject the resource
  • set overwrites the header; add appends
  • The rewrite happens at the proxy — the client sees no change to the URL or response
Last modified on June 3, 2026