You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ta2013,
I am currently working on a URL rewriting feature and was wondering if a system like the one proposed in issue #1161 would meet your needs. Please let me know your thoughts!
Thanks for the response. I realized my initial query had an error with the upstream configuration. Apologies for the confusion. I'll reach out if I need further clarifications. Appreciate your help!
The on-wire Host: reaching the backend is rewritten to myurl.example.com; the original host is preserved on the request via X-Forwarded-Host so backends that need to reconstruct the original URL can read it there. Documented under doc/configure.md (Frontend redirect, URL rewrite, and custom headers section). This is the Sōzu equivalent of Envoy's host_rewrite_literal.
Companions on the same shape:
rewrite_path — rewrite the URL path (analogous to Envoy's prefix_rewrite).
rewrite_port — rewrite the port carried in the Location: header on a permanent redirect.
$HOST[n] / $PATH[n] capture placeholders work inside rewrite_host / rewrite_path when the frontend's hostname or path is a regex (the n-th group is captured at lookup time).
Activity
FlorentinDUBOIS commentedon Nov 15, 2024
Hello 👋,
Glad to see that you are using Sōzu.
To me, this feature is not configurable in Sōzu currently.
you could not rewrite path or authority of a request.
Wonshtrum commentedon Nov 15, 2024
This is similar to #1009.
I would gladly work on a rewrite/redirect feature, but we must first define the scope and granularity to configure it.
Wonshtrum commentedon Dec 11, 2024
Hi @ta2013,
I am currently working on a URL rewriting feature and was wondering if a system like the one proposed in issue #1161 would meet your needs. Please let me know your thoughts!
ta2013 commentedon Dec 13, 2024
Thanks for the response. I realized my initial query had an error with the upstream configuration. Apologies for the confusion. I'll reach out if I need further clarifications. Appreciate your help!
FlorentinDUBOIS commentedon Apr 30, 2026
Addressed on
mainby per-frontendrewrite_host. Configure on a frontend like:The on-wire
Host:reaching the backend is rewritten tomyurl.example.com; the original host is preserved on the request viaX-Forwarded-Hostso backends that need to reconstruct the original URL can read it there. Documented underdoc/configure.md(Frontend redirect, URL rewrite, and custom headerssection). This is the Sōzu equivalent of Envoy'shost_rewrite_literal.Companions on the same shape:
rewrite_path— rewrite the URL path (analogous to Envoy'sprefix_rewrite).rewrite_port— rewrite the port carried in theLocation:header on a permanent redirect.$HOST[n]/$PATH[n]capture placeholders work insiderewrite_host/rewrite_pathwhen the frontend's hostname or path is a regex (the n-th group is captured at lookup time).Closing as addressed.
fix(router,mux,answers): close PR #1162 follow-up gaps on main
fix(router,mux,answers): close PR sozu-proxy#1162 follow-up gaps on main