HAProxy and Gitlab-CE


#1

Trying to et HAProxy to work with Gitlab, I have it working with confluence just fine. I have the port open on all the remote server.

Here is my config so far:

defaults
    mode                    tcp
    log                     global
    option                  tcplog
    option                  log-health-checks
    option                  dontlognull
    option                  allbackups
    #option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout connect         5000
    timeout client          50000
    timeout server          50000
    timeout check           10s
    maxconn                 20000


listen stats 10.150.1.61:1936
    mode http
    #option httpclose
    stats   enable
    stats show-legends
    stats uri /
    stats refresh 5s
    stats show-node
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------

frontend smtp_inbound
        bind 0.0.0.0:25
        mode tcp
        log global
        option tcplog
        default_backend smtp_outbound
        log-format {"type":"haproxy","timestamp":%Ts,"http_status":%ST,"http_request":"%ci","bytes_read":%B,"upstream_addr":"%si","backend_name":"%b","retries":%rc,"bytes_uploaded":%U,"upstream_response_time":"%Tc","session_duration":"%Tt","termination_state":"%ts"}

frontend confluence_f
   bind 10.150.1.61:80 name confluence.borg.local
   reqadd X-Forwarded-Proto:\ http
   default_backend confluence_b

frontend gitlab_in
        bind *:80
        mode http
        option httplog
        default_backend gitlab_out
        timeout client 6h
        reqadd X-Forward-Proto:\ http

        acl host_npm hdr(host) -i gitlab1.borg.local
        acl host_gitlab_ci hdr(host) -i gitlab1.borg.local
        acl host_gitlab hdr(host) -i gitlab1.borg.local
#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------

backend smtp_outbound
  mode tcp
  log global
  balance roundrobin
  option smtpchk HELO mta1.borg.local
  option redispatch
#  timeout server 1m
#  timeout connect 40s
  server mta1.borg.local 10.150.1.75:10024 send-proxy
  server wayne           10.20.30.69:10025 send-proxy 
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
#backend app
#    balance     roundrobin
#    server  app1 127.0.0.1:5001 check
#    server  app2 127.0.0.1:5002 check
#    server  app3 127.0.0.1:5003 check
#    server  app4 127.0.0.1:5004 check

backend confluence_b 10.150.1.61:80
        mode http
        stats enable
        option httpchk
        option httpchk OPTIONS /
        option http-server-close
        option forwardfor
        #option redispatch
        cookie JESSIONID prefix
        appsession JSESSIONID len 52 timeout 6h
        cookie LB insert
        server confluence1 10.150.1.65:8090 check inter 5000


backend gitlab_out
        mode http
        balance roundrobin
        cookie JESSIONID prefix
        option httpclose
        option forwardfor
        server gitlab1 10.150.1.65:8080

Not sure what I’m doing wrong.


#2

could you take the time to describe the problem?
Please share some log lines too.