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

    LetsEncrypt HTTP-01 || ALPN-01 challenge with NAT & HAProxy

    Scheduled Pinned Locked Moved ACME
    3 Posts 2 Posters 896 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.
    • G
      glide
      last edited by

      Here are some hightlights of my situation:

      • I'm using a unique WAN IP
      • Multiple domains routed with HAProxy
      • Domains are supplied by multiple registrars (mostly OVH & Gandi)
      • All HTTP is redirected to HTTPS

      HTTP-01 & ALPN-01 challenges seem to be the easiest methods for my case.
      If I understand well, these challenge methods require the WAN IP to redirect respectively the ports 80 or 443 to the standalone HTTP server.

      So for example if I'm using the HTTP challenge and add a NAT rule to redirect the port 80 on pfSense IP, my first question is:
      How can I still get the regular requests on 80 ?
      that is supposed to return the HTTPS redirection

      Maybe a dump question, I'm sure there is something I'm not getting here.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        You can't do it that way.

        Since you are already using the ports for HAProxy, you'll need to either use a DNS-based ACME method or use a method that integrates with HAProxy to serve the ACME content.

        Search around the forum, there are setup examples that use a python script with HAProxy to integrate it into the ACME process.

        Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 1
        • G
          glide
          last edited by glide

          The HAProxy hint did the trick. For others searching, here is what I did on HAProxy config:

          • Defined a specific backend pointing on 127.0.0.1 with the port defined on ACME config
          • On the frontend added an ACL to forward the requests for which path starts with /.well-know/... onto the previous backend

          Seems to work fine.
          Don't hesitate to suggest any improvement though.
          In another hand I saw that it could be a small security breach, but I don't see the issue, I'd be interested to know.

          Thanks for the help.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.