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

Multiple Web Servers

Scheduled Pinned Locked Moved NAT
17 Posts 3 Posters 1.1k 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.
  • N
    natethegreat21
    last edited by Dec 2, 2022, 6:22 PM

    Hey guys I know this is going to be a stupid question so please forgive me but I have only had 1 web server for the longest time and used port forwarding for ports 80 and 443 now I have a new web server and that also needs ports to be forwarded to the subdomain I created so im having a difficult time trying to find the best way to do that in PFSense. Thank you!

    V 1 Reply Last reply Dec 2, 2022, 6:30 PM Reply Quote 0
    • V
      viragomann @natethegreat21
      last edited by Dec 2, 2022, 6:30 PM

      @natethegreat21
      Port forwarding is based an IPs and ports only. It cannot determine the host name.
      So either get a second public IP for the additional server or install HAproxy on pfSense. HAproxy works on layer 7 and can detect the domain or host name and forward requests to the proper backend server.

      If your websites are less critical you can also run a proxy on one of the web servers. That's what I do in my home setup, because proxying on Apache is quite simple.

      N 1 Reply Last reply Dec 2, 2022, 6:35 PM Reply Quote 0
      • N
        natethegreat21 @viragomann
        last edited by Dec 2, 2022, 6:35 PM

        @viragomann Okay I think I will try the HAproxy I will need to look up how to set it up as I haven't used it before but thanks so much for your help!

        V 1 Reply Last reply Dec 2, 2022, 6:42 PM Reply Quote 0
        • V
          viragomann @natethegreat21
          last edited by Dec 2, 2022, 6:42 PM

          @natethegreat21
          I learned somethings from here:
          https://github.com/ahuacate/pfsense-haproxy/blob/master/README.md
          https://docs.deeztek.com/books/pfsense/page/pfsense-haproxy-softether-vpn
          https://cbonte.github.io/haproxy-dconv/2.2/configuration.html

          N 2 Replies Last reply Dec 2, 2022, 6:47 PM Reply Quote 0
          • N
            natethegreat21 @viragomann
            last edited by Dec 2, 2022, 6:47 PM

            @viragomann Thats super helpful. Thank you so much!

            1 Reply Last reply Reply Quote 0
            • N
              natethegreat21 @viragomann
              last edited by Dec 2, 2022, 9:23 PM

              @viragomann I installed and setup the software but for some reason its not passing any traffic to the destinations. HAProxy 7.PNG HAProxy 6.PNG HAProxy 5.PNG HAProxy 4.PNG HAProxy 3.PNG HAProxy 2.PNG HAProxy 1.PNG

              N V 2 Replies Last reply Dec 2, 2022, 9:36 PM Reply Quote 0
              • N
                natethegreat21 @natethegreat21
                last edited by Dec 2, 2022, 9:36 PM

                @natethegreat21 Stats.PNG

                1 Reply Last reply Reply Quote 0
                • V
                  viragomann @natethegreat21
                  last edited by viragomann Dec 2, 2022, 10:01 PM Dec 2, 2022, 9:59 PM

                  @natethegreat21
                  I'm not expirenced with TCP mode, I only use https with SSL offloading.
                  For http/s offloading mode you need to import your SSL certificates into pfSense.

                  Anyway you need a pair of ACL + Action for each backend.
                  Each ACL must have a unique name if you configure both in a single frontend, e.g. game, nextcloud.

                  In TCP mode the proxy cannot read the host header, so it doesn't know the host name. It could only see the SNI.
                  So you might have to uncheck the ACL expression you have to select something like "SNI extension matches" and enter the SAN name of the SSL certificate.

                  Also I can't really see how you did the port 80 redirection.

                  N 1 Reply Last reply Dec 2, 2022, 11:14 PM Reply Quote 0
                  • N
                    natethegreat21 @viragomann
                    last edited by natethegreat21 Dec 2, 2022, 11:46 PM Dec 2, 2022, 11:14 PM

                    @viragomann Im going to change it to offloading. What are you missing for port 80. Does it not makes sense?Yeah so now its saying the site cant provide a secure connection SSL error probably because the certs are not there. Should I just generate new certs or reuse the existing one on the Linux box?

                    N V 2 Replies Last reply Dec 2, 2022, 11:26 PM Reply Quote 0
                    • N
                      natethegreat21 @natethegreat21
                      last edited by natethegreat21 Dec 2, 2022, 11:26 PM Dec 2, 2022, 11:26 PM

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • V
                        viragomann @natethegreat21
                        last edited by Dec 3, 2022, 12:20 AM

                        @natethegreat21 said in Multiple Web Servers:

                        What are you missing for port 80. Does it not makes sense?

                        I simply cannot see, how it works from your screenshots.

                        Should I just generate new certs or reuse the existing one on the Linux box?

                        Sounds like you're using self-signed certificates.
                        If so you can generate new one as well, but you can also import existing certificates into pfSense using the cert manager and assign them then in HAproxy.

                        N 4 Replies Last reply Dec 3, 2022, 12:29 AM Reply Quote 0
                        • N
                          natethegreat21 @viragomann
                          last edited by Dec 3, 2022, 12:29 AM

                          @viragomann I just used Acme and generated some LetsEncrypt certs as well as added them to the DNS on my domain provider. Anything greyed out is my Pubilc IP or the web address.

                          1 Reply Last reply Reply Quote 0
                          • N
                            natethegreat21 @viragomann
                            last edited by Dec 3, 2022, 12:38 AM

                            @viragomann http3.PNG http2.PNG http1.PNG

                            1 Reply Last reply Reply Quote 0
                            • N
                              natethegreat21 @viragomann
                              last edited by Dec 3, 2022, 12:41 AM

                              @viragomann Backend 1.PNG

                              1 Reply Last reply Reply Quote 0
                              • N
                                natethegreat21 @viragomann
                                last edited by Dec 3, 2022, 12:45 AM

                                @viragomann Frontend 3.PNG Frontend 2.PNG Frontend 1.PNG

                                N 1 Reply Last reply Dec 4, 2022, 7:50 PM Reply Quote 0
                                • N
                                  natethegreat21 @natethegreat21
                                  last edited by Dec 4, 2022, 7:50 PM

                                  @natethegreat21 Closing this out and opening a new topic.

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    hazeltorres
                                    last edited by Dec 7, 2022, 5:02 PM

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