Skip to content

Add --change-origin option as a passthrough to node-http-proxy's chan… #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/configurable-http-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ args
.option("--no-prepend-path", "Avoid prepending target paths to proxied requests")
.option("--no-include-prefix", "Don't include the routing prefix in proxied requests")
.option("--auto-rewrite", "Rewrite the Location header host/port in redirect responses")
.option("--change-origin", "Changes the origin of the host header to the target URL")
.option(
"--protocol-rewrite <proto>",
"Rewrite the Location header protocol in redirect responses to the specified protocol"
Expand Down Expand Up @@ -214,6 +215,10 @@ if (args.autoRewrite) {
options.autoRewrite = true;
log.info("AutoRewrite of Location headers enabled.");
}
if (args.changeOrigin) {
options.changeOrigin = true;
log.info("Change Origin of host headers enabled.");
}

if (args.protocolRewrite) {
options.protocolRewrite = args.protocolRewrite;
Expand Down