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

    Using HAProxy to redirect WAN port 80 to WAN Port 443 using webconfigurator

    Scheduled Pinned Locked Moved Cache/Proxy
    6 Posts 3 Posters 12.0k 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.
    • T
      tazmo
      last edited by

      I have HAProxy working with two backends doing SSL offload. It works well.

      But I would like to redirect all WAN port 80 traffic to the WAN SSL port 443.

      I found this thread over one stackoverflow showing how to do this:
      https://stackoverflow.com/questions/13227544/haproxy-redirecting-http-to-https-ssl

      It puts the following line in each of the front end configs:
      redirect scheme https code 301 if !{ ssl_fc }

      After reading the docs, I think this is what I need.

      How do I add this line through the pfSense web GUI?

      I see where you can add global options but not to each frontend… or am I missing it???

      Any help or pointers would be appreciated.

      Bob

      M 1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        What I'm doing here is:

        1/ Create a http frontend on port 80.
        Create ACLs there to match your hosts (Host matches)
        Action:

        • http-request redirect
        • rule: scheme https code 301
        • ACLs: as needed

        2/ Create a dummy backend (see screenshot)
        3/ Set the dummy backend as default for your other frontends.
        4/ (Optional: Create some fancy 503 error page to serve for the dummy backend.)

        Screenshot_HAproxy_dummy_backend.png
        Screenshot_HAproxy_dummy_backend.png_thumb

        1 Reply Last reply Reply Quote 2
        • T
          tazmo
          last edited by

          Thanks for responding but I'm missing something…. I keep getting:

          The field 'Name' contains invalid characters.

          The WAN traffic incoming to WAN port 80 is redirected WAN port 443.

          What would the acl's be then?

          I must not have read enough of the docs  :(

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            @tazmo:

            The field 'Name' contains invalid characters.

            Huh? What are you putting there?

            1 Reply Last reply Reply Quote 0
            • T
              tazmo
              last edited by

              fat fingered it…. had a space.

              I think that got it... I'll test in a little while.

              Thank you for the response!

              1 Reply Last reply Reply Quote 0
              • M
                manjunath @tazmo
                last edited by

                @tazmo

                I have Pfsense with HAProxy installed in it .can u guide how to do load balance between two AWS EC2 Web server Instance with SSL. Even i have SSL purchased from the 3rd party tool.

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