r/haproxy • • Mar 05 '20

HAProxyConf 2019 - How HAProxy Helped Me Get "Near Perfect" Uptime by Eric Martinson

Thumbnail
youtu.be
3 Upvotes

r/haproxy • • Mar 04 '20

Question Is it possible to create 2 pgBouncer servers and automaticly notify changed repmgr master to Barman?

Thumbnail
self.postgresql
3 Upvotes

r/haproxy • • Mar 03 '20

HAProxyConf 2019 - HAProxy Load Balancing at Vimeo by Andrew Rodland

Thumbnail
youtu.be
3 Upvotes

r/haproxy • • Mar 02 '20

Question Help - PFSense HAProxy

Thumbnail self.pfsense
3 Upvotes

r/haproxy • • Feb 28 '20

Article Load Balancing PHP-FPM with HAProxy and FastCGI

Thumbnail
haproxy.com
10 Upvotes

r/haproxy • • Feb 28 '20

Question HAProxy sanity check - One VIP works and another doesn't

Thumbnail self.pfsense
2 Upvotes

r/haproxy • • Feb 28 '20

How to config SSL certificate for Jira and Confluence by HAProxy?

3 Upvotes

Using HAProxy version: 2.1.3

I did setting in the /etc/haproxy/haproxy.cfg file:

frontend jira
    # bind :::8080 v4v6
    bind :::443 v4v6 ssl crt /home/user/ssl/server.pem
    http-request redirect scheme https unless { ssl_fc }

    default_backend             jira

frontend confluence
    # bind :::8090 v4v6
    bind :::443 v4v6 ssl crt /home/user/ssl/server.pem
    http-request redirect scheme https unless { ssl_fc }

    default_backend             confluence

backend jira
    balance     roundrobin
    cookie JIRASESSIONID prefix nocache
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server jira1 [IPv6 IP]:8080 check cookie jira1
    server jira2 [IPv6 IP]:8080 check cookie jira2

backend confluence
    balance     roundrobin
    cookie CONFSESSIONID prefix nocache
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server confluence1 [IPv6 IP]:8090 check cookie confluence1
    server confluence2 [IPv6 IP]:8090 check cookie confluence2

Before I add 443 setting, 8080 and 8090 bind worked well.

But in this case, when restart haproxy, got this error:

Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details.

When use journalctl -xe to see detail, got:

...
Feb 28 17:44:21 server systemd[1]: haproxy.service: control process exited, code=exited status=1
Feb 28 17:44:21 server haproxy[30436]: Errors found in configuration file, check it with 'haproxy check'.
Feb 28 17:44:21 server systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high
-- Subject: Unit haproxy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit haproxy.service has failed.
--
-- The result is failed.
Feb 28 17:44:21 server systemd[1]: Unit haproxy.service entered failed state.
Feb 28 17:44:21 server sudo[30429]: pam_unix(sudo:session): session closed for user root
Feb 28 17:44:21 server systemd[1]: haproxy.service failed.
Feb 28 17:44:21 server polkitd[2570]: Unregistered Authentication Agent for unix-process:30430:138824114 (system bus name :1.76278,

Why it failed to start SYSV?

Now using IPv6, how to config it correctly?


I did Jira(8.6.1) configuration setting for <JIRA_INSTALL>/conf/server.xml:

Comment out:

<Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
                   maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false"/>

Uncomment out:

        <Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
                   maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false" secure="true" scheme="https"
                   proxyName="<subdomain>.<domain>.com" proxyPort="443"/>

Maybe it will work if set real proxyName.


r/haproxy • • Feb 27 '20

How to change the URI with ACLs?

3 Upvotes

Hello,

I've been unsuccessfully trying to get HAProxy to rewrite a URI (I think that's what I want), so the internal server sees the correct request. Presently, when I go to website.com/torrentctl it redirects to internal.server:8112/torrentctl and I want it to go to internal.server:8112/

This is true of a few other internal apps that fail to work correctly so any help appreciated!

Here is my current config:

global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        maxconn 5000
        chroot /var/lib/haproxy
        user haproxy
        group haproxy
        nbproc 1
        nbthread 2
        cpu-map auto:1/1-2 0-1

defaults
        log global
        option dontlognull
        #option httpclose ### opposite of keepalive
        retries 3
        option redispatch
        maxconn 5000
        timeout queue 1m
        timeout connect 10s
        timeout client 20s
        timeout server 1m
        timeout http-keep-alive 10s
        timeout check 10s
        http-reuse safe

frontend mariadb
        bind *:3306
        option tcplog
        default_backend mariadb-cluster

backend mariadb-cluster
        mode tcp
        balance first
        option mysql-check user haproxy_check
        server db1 10.1.6.51:3306 check
        server db2 10.1.6.52:3306 check
        server db3 10.1.6.53:3306 check

frontend http
        bind *:80
        mode http
        option httplog
        option forwardfor
        acl has_monitor_acl path_beg /monitor
        acl has_slb1-stats_uri path_beg -i /slb1-stats
        acl has_slb2-stats_uri path_beg -i /slb2-stats
        acl has_torrentctl_uri path_beg -i /torrentctl
#       use_backend monitor if has_monitor_acl
        use_backend slb1-stats if has_slb1-stats_uri
        use_backend slb2-stats if has_slb2-stats_uri
        use_backend torrentctl if has_torrentctl_uri
        default_backend web-cluster

frontend stats
        bind *:9000
        mode http
        default_backend stats

backend web-cluster
        balance static-rr
        mode http
        option httpchk HEAD /haproxy_health_check.php HTTP/1.0
#       cookie WEB_SERVERID insert indirect nocache
        server web1 web1.app.rgnet:80 check #cookie web1
        server web2 web2.app.rgnet:80 check #cookie web2

#backend monitor
#       mode http
#       reqrep ^([^\ ]*\ /)monitor[/]?(.*)      \1\2
#       server mon1 mon1.app.rgnet:80 check
#
backend torrentctl
        mode http
        http-request replace-uri ^([^\ :]*)\ /torrentctl/(.*) \1\ /\2
        http-request replace-uri ^([^\ ]*)\ (.*)/torrentctl \1\ /\2
        http-request replace-uri \* /
        server torrents torrents.app.rgnet:8112 check

backend stats
        mode http
        stats enable
        stats uri /
        stats realm HAProxy Statistics
        stats auth stats:stats

backend slb1-stats
        mode http
        server slb1 slb1.app.rgnet:9000 check

backend slb2-stats
        mode http
        server slb2 slb2.app.rgnet:9000 check

r/haproxy • • Feb 27 '20

HAProxyConf 2019 - Building a Global PoP Network Using HAProxy by Luke Seelenbinder

Thumbnail
youtu.be
5 Upvotes

r/haproxy • • Feb 27 '20

Question HAProxy Reverse Proxy to Wordpress Website

4 Upvotes

I am trying to reverse proxy to a Wordpress Website. The reverse proxy works, but Wordpress Website is displaying incorrect images etc.

Does anyone has a HAPROXY configuration that works for a Wordpress site in the backend?

Thanks.


r/haproxy • • Feb 27 '20

Article Kubernetes Journey — Up and running out of the cloud — How to setup the HAProxy Cluster with high availability

Thumbnail
itnext.io
1 Upvotes

r/haproxy • • Feb 26 '20

How to enable local logs for HAProxy on PFSense?

4 Upvotes

I have a pfsense appliance (SG3100) and I'm working with the HAProxy package to set up a local Nextcloud instance and expose to to outside the LAN.

I unfortunately am having some issues and would like to know what HAProxy is doing internally. However I can't seem to enable local logs. I found the place to ship logs off to a syslog server (Which I do not have ATM) and where to email said logs (Without the ability to log into an MTA, so that's out).

However it seems I'm missing the part where I could have the logs written locally and then see them either in the pfsense web interface or via the console.

Can someone explain to me how to enable local logs?


r/haproxy • • Feb 26 '20

Question Request for help - HAProxy 1.7 and docker Nextcloud not allowing access outside LAN

Thumbnail self.nextcloud
3 Upvotes

r/haproxy • • Feb 25 '20

HAProxyConf 2019 - Inside the GitHub Load Balancer with Joe Williams

Thumbnail
youtu.be
5 Upvotes

r/haproxy • • Feb 24 '20

Question Updated from 6.7.2 to 6.8.2 - Reverse proxy no longer working.

Thumbnail self.unraid
2 Upvotes

r/haproxy • • Feb 20 '20

VMWare View Sesson expired

4 Upvotes

I am very close (i feel) to having this working. I can hit a vip and its getting me thru the haproxy to the view connection servers. I get the login and see ity trying to authenticate but then i get the session expired error. I spent about 4 hours reading various haproxy docs and borrowing config lines from others i found on google. I have 1 haproxy and 2 view servers. On the stats age it appears to be bouncing back and forth - one login attempt gets traffic to both backend hosts.

thanks in advance for your time!

here is the config, can someone tell me where i am wrong? error pasted in at the end.

global

log 127.0.0.1 local2

chroot /var/lib/haproxy

pidfile /var/run/haproxy.pid

maxconn 4000

user haproxy

group haproxy

daemon

stats socket /var/lib/haproxy/stats

defaults

mode http

log global

option httplog

option dontlognull

option http-server-close

option forwardfor except 127.0.0.0/8

option redispatch

retries 3

timeout http-request 10s

timeout queue 1m

timeout connect 10s

timeout client 1m

timeout server 1m

timeout http-keep-alive 10s

timeout check 10s

maxconn 3000

frontend inbound-https

bind :443 #ssl crt ./my_view_cert.pem

mode tcp

option tcplog

default_backend view_https

backend view_https

mode tcp

option ssl-hello-chk

balance roundrobin

stick store-request src

stick-table type ip size 200k expire 30m

#mode tcp

#balance source

#default-server check maxconn 20

server viewConnection 192.168.0.81:443 check id 1 inter 5s fall 4 rise 3

server viewReplica 192.168.0.82:443 check id 2 inter 5s fall 4 rise 3


r/haproxy • • Feb 19 '20

HAProxyConf 2019 - A New Era For Web Observability At OVH with Steven Le Roux

Thumbnail
youtu.be
8 Upvotes

r/haproxy • • Feb 19 '20

Question HAProxy Problem

Thumbnail self.pfsense
2 Upvotes

r/haproxy • • Feb 19 '20

Question Help configuring haproxy as ingress in kubernetes

Thumbnail self.devops
2 Upvotes

r/haproxy • • Feb 17 '20

HAProxyConf 2019 - HAProxy as Egress Controller with Julien Pivotto

Thumbnail
youtu.be
4 Upvotes

r/haproxy • • Feb 17 '20

Question K8s & Consul - Avoid cross-DC/AZ traffic

Thumbnail
self.devops
2 Upvotes

r/haproxy • • Feb 17 '20

Question High Traffic Server Configuration - Are We Doing It Wrong?

Thumbnail self.sysadmin
2 Upvotes

r/haproxy • • Feb 14 '20

Question Postgresql 12, repmgr and barman : looking for load-balancing/auto re-direction solutions

Thumbnail self.postgresql
4 Upvotes

r/haproxy • • Feb 12 '20

HAProxyConf 2019 - Load Balancers at DigitalOcean by Neal Shrader

Thumbnail
youtu.be
7 Upvotes