I'm trying to set up haproxy as reverse proxy for several webservers in my local network to be accessible from the domain name pointing to the router. Port 80 is being forwarded to the haproxy machine. Haproxy is running on a FreeBSD 11.4 jail inside a FreeNAS machine. Being new to haproxy and after playing around with many different settings in the /usr/local/etc/haproxy.conf, I put together this extremely basic example that already isn't working. Here is my haproxy.conf:

    maxconn 2048
    tune.ssl.default-dh-param 2048
    log stdout local0 debug
    user haproxy
    group haproxy

    mode http
    timeout connect 5000
    timeout client  50000
    timeout server  50000

frontend public-web-in
    bind :80
    use_backend test

backend test
    description A simple test server
    server test check

In my understanding, this should listen to HTTP requests made to port 80 and forward them to the backend server test, but when I try to access via the public domain, or the local ip address of the haproxy machine, I get the 400 Bad Request ERR_INVALID_REQ.

I checked that there is no problem with the test server itsself, directly addressed it works fine, there is no firewall rules that would block port 80 on the haproxy machine. Intruigingly, if I type service haproxy start, there is no output, but also no termination of the command:

root@HAProxy:~ # service haproxy start
Starting haproxy.

Running haproxy in debug mode does not show anything else and has the same problem:

root@HAProxy:~ # haproxy -db -f /usr/local/etc/haproxy.conf

Is there something wrong with my installation of haproxy in general?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.