Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using HAProxy for load balancing a couple of web servers (HTTP mode). The web servers are strictly dynamic, ie, there isnt any static content, only web services.
The URLs of the type (analogous)

Now, when i configure HAProxy to forward the incoming requests to these 3 urls on couple of machines, I'm specifying the url_path using acl and path_end/path_beg, but upon placing the request I get Not Found on Accelerator error, which is making it harder to pin point the problem.

Below is the configuration that I'm using. Also, it is not logging any errors.

        log   local0
        log   local1 notice
        maxconn 4096
        user haproxy
        group haproxy

        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        maxconn 2000
        contimeout      5000
        clitimeout      10000
        srvtimeout      10000

frontend http_proxy
        acl is_small path_end -i small
        acl is_medium path_end -i medium
        acl is_large path_end -i large

        use_backend web_server_small if is_small
        use_backend web_server_medium if is_medium
        use_backend web_server_large if is_large

backend web_server_small
        mode http
        balance roundrobin
        option httpclose
        server  web_1 check
        server  web_2 check

backend web_server_medium
        mode http
        balance roundrobin
        option httpclose
        server  web_1 check
        server  web_2 check

backend web_server_large
        mode http
        balance roundrobin
        option httpclose
        server  web_1 check
        server  web_2 check

Is it possible to send the request from HAProxy to the web_server with the url_path?.

If HAProxy receives it as, then send the request to the webserver as

share|improve this question

As your path is contained to the start of the URL why not use path_beg, the recommended use for path_end is for file name extensions.

        acl is_small path_beg -i /small
        acl is_medium path_beg -i /medium
        acl is_large path_beg -i /large
share|improve this answer
Good point. Unfortunately, that doesnt seem to solve the problem. – Rakesh Jan 20 '14 at 6:18
Have you checked manually from the haproxy server whether you can connect to the backend machines on those URL's? – Francois Wolmarans Jan 20 '14 at 6:24
Do you mean to ask whether the backend servers are up? Those are running and the corresponding URLs are functional as well. – Rakesh Jan 20 '14 at 6:29
You need to be on the haproxy server and test whether you can access the servers/URL's from there. – Francois Wolmarans Jan 20 '14 at 6:35
Well, that is the problem. If I host a server without any url_path, say and not, then it forwards the request. But I'm not able to forward it with the url_path. Atleast none of the configurations that I tried worked. Any idea how to include the url path with the forwarded request? – Rakesh Jan 20 '14 at 7:45

The path of a HTTP request is always handed to the backend server, i.e.

GET /small HTTP/1.1

will be visible behind HAproxy as just that request. If you suspect that this somehow is truncated to

GET / HTTP/1.1

on the server behind HAproxy, you should check for this using

tcpdump -i any port 8080 -As1024 | grep GET

on that server and watch the inbound GET requests.

I'm going on a limb and assume that you expect HAproxy to insert something in the front of the URI, like

    server web_1 check

would turn a request for /small into a request for /my/path/small. This can be achieved by using the reqrep option, see the docuementation for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.