I have nginx in entry point to server. which handle SSL connection and send HTTP
request in /api/v1/
to HAproxy for balancing.
this is my nginx config:
location /api/v1/ {
proxy_pass http://127.0.0.1:8585/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
and HAproxy config:
frontend haproxy_entry
bind *:8585
mode http
log global
acl is_api url_beg /api/v1/
use_backend api if is_api
the problem I have is that I should pass /api/v1/
path twice. if I request https://servername.com/api/v1/
haproxy would not handle this properly but for :https://servername.com/api/v1/api/v1/
it's ok. how can i fix this?
/api/v1/
. Are you saying that it should pass the request transparently? If so, just remove the trailing/
from theproxy_pass
statement.