• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

HAProxy: one site needs ssl offloading, another doesn't, how to accommodate both?

Scheduled Pinned Locked Moved Cache/Proxy
4 Posts 3 Posters 2.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    ceffy
    last edited by ceffy Dec 31, 2019, 12:04 AM Dec 31, 2019, 12:00 AM

    Hi guys,

    I have 2 domain, say, aaa.my.tld (a VM) and bbb.my.tld (a docker);

    Each frontend works well with HAProxy on its own (when the other's frontend is disabled):

    A. aaa.my.tld terminates ssl at the VM level so it doesn't need ssl offloading by pfsense.
    DDNS + HAProxy + Frontend A (WITHOUT ssl-offloading) + Backend A

    B. bbb.my.tld is a docker and doesn't have its own certificates, so it does need ssl offloading by pfsense.
    DDNS + HAProxy + Frontend B (WITH ssl-offloading) + Backend B

    But how do I make HAProxy work with both simultaneously?

    What's blocking me is the following option, which is enabled/disabled at the frontend level:
    alt text

    pfSense asks me to use "shared frontend", i tried but didn't success.

    Does someone know how to set it up? Thanks!

    P 1 Reply Last reply Dec 31, 2019, 1:51 AM Reply Quote 0
    • P
      PiBa @ceffy
      last edited by Dec 31, 2019, 1:51 AM

      @ceffy
      Move 'FrontendB' to a loopback interface or the lan or use a nonstandard port...
      Give the 'Frontend A' a acl that checks for the SNI hostname of bbb.my.tld, then create a use-backend action for that acl and create a new backend 'ForwardToFrontendB' that will then provide a servercertificate to the client as usual. Yes its a extra 'roundtrip' but you cant configure 1 binding to do both sni/tcpforwarding and https-offloading at the same time..

      S 1 Reply Last reply Feb 23, 2020, 12:15 AM Reply Quote 3
      • C
        ceffy
        last edited by ceffy Dec 31, 2019, 9:57 PM Dec 31, 2019, 8:59 PM

        Edit:
        I found this:
        https://github.com/PiBa-NL/pfsense-haproxy-package-doc/wiki/pfsense_2_3_haproxy_sni_plus_offloading_backends

        Must be what you were referring to. I'm experimenting it now.

        Edit 2:
        HOLY SHIT, I got it working now (after following your guide to the letter of the words):
        https://github.com/PiBa-NL/pfsense-haproxy-package-doc/wiki/pfsense_2_3_haproxy_sni_plus_offloading_backends

        THANK YOU THANK YOU THANK YOU THANK YOU!

        LOVE YOU! HAPPY NEW YEAR!

        1 Reply Last reply Reply Quote 0
        • S
          scurrier @PiBa
          last edited by Feb 23, 2020, 12:15 AM

          @PiBa Thank you! This advice saved me from drastic measures!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received