Hi All,
I've got a pretty simple setup at the moment. A node.js application (REST
API) which is listening on port localhost 8080, and a collection of static
html files which I'd like to be served from nginx listening on localhost
port 8090.
---
frontend public
bind *:80
acl is_api hdr_end(host) -i *api.example.com <http://api.example.com>*
acl is_doc path_beg -i /docs
use_backend apidoc if is_api is_doc
default_backend api
backend api
timeout server 30s
option httpclose
option forwardfor
server api1 127.0.0.1:8080 #check
backend apidoc
timeout server 30s
option httpclose
option forwardfor
server api1 127.0.0.1:8090 #check
---
This setup works fine when I access:
http://example.com/docs/
I see nginx logs, and the page loads (though it takes a couple seconds, not
sure if that is relevant).
However when I try to use:
http://example.com/docs (note: no trailing slash)
I get a long wait, nothing in the nginx logs, and then eventually the URL
in the browser is rewritten to: example.com:8090/docs and fails.
Any ideas what I've got setup wrong here? Seems pretty straightforward to
me and I'd like to avoid trying to hack things with redirecting to force a
slash. Should just work. Initially I thought it was an nginx thing, but
since I don't even get anything in the nginx logs on the second method
(/docs) I assume the failure is happening within haproxy.
Thanks in advance for any help!
-Nick