With this method you set the X-Forwarded-Method, X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Path to let heimdall know the host, respectively domain url and the used HTTP method.
Compared to the previous integration option, the configuration only differs in the definition of the internal /_auth endpoint. So, the example configuration is limited to that part only.
Example 2. Possible Configuration
# nginx.conf
...
location = /_auth {
internal;
proxy_pass http://heimdall:4456; (1)
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Forwarded-Method $request_method; (2)
proxy_set_header X-Forwarded-Proto $scheme; (3)
proxy_set_header X-Forwarded-Host $http_host; (4)
proxy_set_header X-Forwarded-Path $request_uri; (5)
proxy_set_header X-Forwarded-For $remote_addr;
}
| 1 | Configures NGINX to pass the request to heimdall. |
| 2 | Let NGINX forward the used HTTP method to heimdall. |
| 3 | Let NGINX forward the used HTTP schema to heimdall. |
| 4 | Let NGINX forward the used host to heimdall. |
| 5 | Let NGINX forward the used path and query parameter to heimdall. |