From 2139cfacf850650e855ccf965dc060cc259823a7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 9 Jan 2018 16:13:17 +0100 Subject: [PATCH 1/2] Use X-Original-URI instead of X-Forwarded-Path --- nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index 713df5a..ac52b61 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -132,7 +132,7 @@ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port; -proxy_set_header X-Forwarded-Path $request_uri; +proxy_set_header X-Original-URI $request_uri; # Mitigate httpoxy attack (see README for details) proxy_set_header Proxy ""; From 53784fad46ba3a2559f606897152bc57d4fddd3d Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 9 Jan 2018 16:15:52 +0100 Subject: [PATCH 2/2] Update Documentation for X-Original-URI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5997a46..9d19f82 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ You can also use wildcards at the beginning and the end of host name, like `*.ba You can have multiple containers proxied by the same `VIRTUAL_HOST` by adding a `VIRTUAL_PATH` environment variable containing the absolute path to where the container should be mounted. For example with `VIRTUAL_HOST=foo.example.com` and `VIRTUAL_PATH=/api/v2/service`, then requests to http://foo.example.com/api/v2/service will be routed to the container. If you wish to have a container serve the root while other containers serve other paths, make give the root container a `VIRTUAL_PATH` of `/`. Unmatched paths will be served by the container at `/` or will return the default nginx error page if no container has been assigned `/`. -The full request URI will be forwarded to the serving container in the `X-Forwarded-Path` header. +The full request URI will be forwarded to the serving container in the `X-Original-URI` header. ### Multiple Networks