Skip to content
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

Add preserve request path option #155

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jimmybot
Copy link
Contributor

Add an option :preserve_request_path

reverse_proxy_plug currently maps url paths so that the original directory at
which the route is mounted is not passed over to the destination server

This new option preserve_request_path allows for the original directory to be
passed back so that the destination server receives the full original request
path

For example, if the option is set to true and ReverseProxyPlug were mounted at
a route '/abc' and a request came in as '/abc/123', the destination server
would be requested '/abc/123' and not '/123'

Plug.Conn has a special key host that is used to store host information instead
of relying on the list of headers. In newer versions of Plug.Conn, it raises an
error if put_req_header is used to set host to prevent this mistake.

Read host from the right place and update tests.
…1.10

Fix credo issue: Enum.map |> Enum.join now Enum.map_join
reverse_proxy_plug currently maps url paths so that the original directory at
which the route is mounted is not passed over to the destination server

This new option preserve_request_path allows for the original directory to be
passed back so that the destination server receives the full original request
path

For example, if the option is set to true and ReverseProxyPlug were mounted at
a route '/abc' and a request came in as '/abc/123', the destination server
would be requested '/abc/123' and not '/123'
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.

1 participant