Skip to content

Add preserve-host option for reverse proxy stanzas#328

Merged
jappeace merged 1 commit intosnoyberg:masterfrom
jezen:preserve-host
Mar 7, 2026
Merged

Add preserve-host option for reverse proxy stanzas#328
jappeace merged 1 commit intosnoyberg:masterfrom
jezen:preserve-host

Conversation

@jezen
Copy link
Copy Markdown
Collaborator

@jezen jezen commented Feb 6, 2026

Summary

  • Adds a preserve-host configuration option to reverse proxy stanzas
  • When set to true, the Host header from the original request is preserved when proxying
  • Defaults to false to maintain backward compatibility

Usage

stanzas:
  - type: reverse-proxy
    reversed-host: localhost
    reversed-port: 3000
    reversing-host: sub.domain.com
    preserve-host: true

This mirrors functionality available in nginx (proxy_set_header Host $http_host) and Apache (ProxyPreserveHost On).

Test plan

  • Added unit tests for config parsing (preserve-host true/false/default)
  • Added unit tests for filterHeaders behavior with both settings
  • All 18 tests pass

Resolves #299

Allows preserving the Host header when proxying requests, controlled
via a new 'preserve-host' config option (defaults to false).

Resolves snoyberg#299
@jappeace
Copy link
Copy Markdown
Collaborator

jappeace commented Mar 7, 2026

oh you should use a seperate account for your worker bee

@jappeace jappeace merged commit d83b92d into snoyberg:master Mar 7, 2026
9 checks passed
@jezen
Copy link
Copy Markdown
Collaborator Author

jezen commented Mar 7, 2026

oh you should use a seperate account for your worker bee

I'm sorry, what?

@jappeace
Copy link
Copy Markdown
Collaborator

jappeace commented Mar 7, 2026

your pr description here looks like it's generated by claude 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve host through reverse proxy

2 participants