For any ingress that uses a non / path e.g. /myapp, trying to hit http://<host>/myapp results in a 301 with an incorrect Location header. Hitting /myapp/ hits the backend as expected.
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Date: Fri, 14 Dec 2018 12:11:47 GMT
Location: http://shin-test-ingress.<domain>:8080/myapp/
Server: nginx
Content-Length: 178
Connection: keep-alive
The 8080 is the port nginx is configured to listen to rather than the listening port of the ELB.
Arguably, hitting /myapp shouldn't be issuing a redirect at all; it's the implementation of
|
location {{ if $location.Path }}{{ $location.Path }}{{ end }} { |
that appends a trailing
/ presumably because
prefix matching was preferred but then users of
feed had to adhere to calling the endpoints with a trailing
/.
My guess is that it's failing to find an exact match so it fallbacks to an approximate match, finds it but then thinks it should issue a 301 to the path it's found.
Historically, most endpoints in feed have been APIs and this was only noticed when someone tried to use a path with a website and a browser although in practise, we tend to just use / as the path if we're fronting Grafana, Jenkins etc.
For any ingress that uses a non
/path e.g./myapp, trying to hithttp://<host>/myappresults in a 301 with an incorrectLocationheader. Hitting/myapp/hits the backend as expected.The
8080is the port nginx is configured to listen to rather than the listening port of the ELB.Arguably, hitting
/myappshouldn't be issuing a redirect at all; it's the implementation offeed/nginx/nginx.tmpl
Line 161 in 319130e
/presumably because prefix matching was preferred but then users offeedhad to adhere to calling the endpoints with a trailing/.My guess is that it's failing to find an exact match so it fallbacks to an approximate match, finds it but then thinks it should issue a 301 to the path it's found.
Historically, most endpoints in
feedhave been APIs and this was only noticed when someone tried to use a path with a website and a browser although in practise, we tend to just use/as the path if we're fronting Grafana, Jenkins etc.