Solved HAProxy Help

I'm trying to use HAProxy as a forwarding proxy.

I have it running on my dedicated server, and I would like to use from home as my http/https proxy in Firefox.

This is what I have so far in my config, and would appreciate if someone can let me know if I'm doing it right - and what am I missing in the "backend proxy_back" section?

Code:
# Global settings
global
    daemon
    maxconn 2048
    ssl-default-bind-ciphers ALL

# Defaults settings
defaults
    timeout connect 5s
    timeout client 30s
    timeout server 30s

resolvers mydns
    nameserver dns1 8.8.8.8:53
    nameserver dns2 8.8.4.4:53
    resolve_retries 3
    timeout resolve 1s
    timeout retry   1s
    hold valid 10s

# Frontend for incoming client connections
frontend http_front
    bind 11.22.33.44:8080
    mode tcp
    default_backend proxy_back

frontend https_front
    bind 11.22.33.44:8080 ssl crt /home/me/haproxy.pem
    mode tcp
    default_backend proxy_back

# Backend to forward requests
backend proxy_back
    mode tcp
    balance roundrobin
    ????
    ????
 
You're binding both HTTP and HTTPS on port 8080, that's not going to work. Also remove the mode tcp from the frontends, you want to proxy HTTP (mode http), not a plain TCP connection.

And the thing you're missing on the backend is a server definition pointing to the webserver.

Code:
backend proxy_back
  server mywebserver 1.2.3.4:80
 
Last edited:
Back
Top