I am a newb to HAProxy, and am bashing my head against this one. I’m trying to set up what I think is a fairly simple exercise in redirecting a url to a specific port. I’d like for http://server.example.com/application to redirect to http://server.example.com:8091. To that end, I have the following config:
global daemon maxconn 256 defaults mode http timeout connect 50000ms timeout client 50000ms timeout server 50000ms frontend http-in bind *:80 acl application url_end application use_backend application_admin if application default_backend web backend application_admin server server1 127.0.0.1:8091 backend web server server1 127.0.0.1:8080
The redirect to 8080 as the default works fine, apache is listening on 8080. But when I go to server.example.com/application, I get a 404 error:
curl -v server.example.com/application * Trying server.example.com... * TCP_NODELAY set * Connected to server.example.com (server.example.com) port 80 (#0) > GET /application HTTP/1.1 > Host: server.example.com > User-Agent: curl/7.51.0 > Accept: */* > < HTTP/1.1 404 Object Not Found < Server: MochiWeb/1.0 (Any of you quaids got a smint?) < Date: Wed, 08 Feb 2017 23:00:51 GMT < Content-Type: text/plain < Content-Length: 10 < Cache-Control: max-age=10 < * Curl_http_done: called premature == 0 * Connection #0 to host server.example.com left intact Not found.
The port does work, because I can browse directly to server.example.com:8091.
Any help greatly appreciated!