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

    Websites Publishing

    Scheduled Pinned Locked Moved Firewalling
    15 Posts 7 Posters 1.1k Views 7 Watching
    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.
    • JKnottJ Offline
      JKnott @Gertjan
      last edited by

      @Gertjan said in Websites Publishing:

      Very old question.
      The answer is always the same : you can't.
      Visitor from Internet will have "site1.mydomain.com" and "site2.mydomain.com" at their disposal and you insist of having both the same IPv4 "a.b.c.d" for these two URL's.
      So, the users - their browsers, wind up using a.b.c.d:443 where 443 is without any discussion - explanations not needed.

      Actually, it is possible. The headers contain the URL for the site. With deep packet inspection, you can read that and process accordingly.

      PfSense running on Qotom mini PC
      i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
      UniFi AC-Lite access point

      I haven't lost my mind. It's around here...somewhere...

      noplanN 1 Reply Last reply Reply Quote 0
      • noplanN Offline
        noplan @JKnott
        last edited by

        @JKnott said in Websites Publishing:

        Actually, it is possible. The headers contain the URL for the site. With deep packet inspection, you can read that and process accordingly.

        allright .... no we are talkin expert level ....

        WTF r u crazy ?
        but hell yeah i like that idea .... kinda sort of konfig everybody loves ;)

        but serious....
        the answer as @Gertjan told is haProxy / letsEnrypt WildCard / and some DNS records

        am i missin some of the fun ?

        GertjanG 1 Reply Last reply Reply Quote 0
        • GertjanG Offline
          Gertjan @noplan
          last edited by

          @noplan said in Websites Publishing:

          am i missin some of the fun ?

          You're spot-on.

          @JKnott : Inspecting packets -means MITM on https. That's even for experts 'hard'.
          Many have been sent into the this proxy forest. Very few came back.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          noplanN JKnottJ 2 Replies Last reply Reply Quote 0
          • noplanN Offline
            noplan @Gertjan
            last edited by

            @Gertjan

            Lights on !
            oh yeahh sing it loud n proud

            MITM ....

            @mohkhalifa do not walk down this trail !

            br NP

            1 Reply Last reply Reply Quote 0
            • JKnottJ Offline
              JKnott @Gertjan
              last edited by

              @Gertjan

              Rewriting URLs to host multiple domains on a single IP address with Apache

              PfSense running on Qotom mini PC
              i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
              UniFi AC-Lite access point

              I haven't lost my mind. It's around here...somewhere...

              GertjanG 1 Reply Last reply Reply Quote 0
              • GertjanG Offline
                Gertjan @JKnott
                last edited by Gertjan

                @JKnott said in Websites Publishing:

                @Gertjan

                Rewriting URLs to host multiple domains on a single IP address with Apache

                👍

                I run myself Apache2 with a couple of domain names, using for each domain name an IPv4 and an IPv6.
                ( but I have no NAT neither firewall or comparable in front of my servers )

                When I saw the local .2 and .3 I defaulted to think of two individual devices, each running a web server like Apache2.
                It could be a unique server with 2 IP's, using a single Apache2 instance, with two 'virtual' web servers, each serving one individual IP. But mapping two local IP"s to the same device makes no sense, as everything is behind a NAT anyway.

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                JKnottJ 1 Reply Last reply Reply Quote 0
                • JKnottJ Offline
                  JKnott @Gertjan
                  last edited by

                  @Gertjan

                  My understanding is that multiple URLs point to the same IP address and then Apache sorts things out, using the host name from the header. As it says in that article "Instead, you can use one of Apache's less well-known features to host multiple domains on a single IP address". To me, that means multiple URLs point to 1 address on one server. That can be done by using the URL that's part of the header. Look at the host field here where it says "The domain name of the server (for virtual hosting)". That is what Apache uses to sort out the different server requests to the same IP address.

                  PfSense running on Qotom mini PC
                  i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                  UniFi AC-Lite access point

                  I haven't lost my mind. It's around here...somewhere...

                  1 Reply Last reply Reply Quote 0
                  • Y Offline
                    yanqian
                    last edited by

                    @mohkhalifa
                    It will be easy if you host both websites in one server.
                    What is the web server you are using ?
                    If it supports SNI, then you can host 2 https site with the same TCP 443 port.
                    Yes, as @Gertjan @JKnott already mentioned before in this thread, they had just told you how to get it done when they are chatting.

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      PhxAzCraig
                      last edited by

                      I do this a lot when I don't have enough public IP addresses for my (client's) needs. It's not convenient, but you can do this by making the requester use a custom port number - let's say port 444 instead of 443. On the firewall, you not only forward port 444 to a different IP than 443, you also port-translate it from 444 to 443 - that way you don't have to modify the server to actually listen on 444 unless you want to. (Might want to if accessing the server from the inside).

                      From the outside, this can be transparent to the users if they can click on a link that redirects them to the URL with port 444. If they have to manually type that into the URL, it can work, but it's ugly and users will get it wrong.

                      Alternatively, as has been suggested, put both websites on the same server and use host headers to get to the correct site.

                      1 Reply Last reply Reply Quote 0
                      • kiokomanK Offline
                        kiokoman LAYER 8
                        last edited by kiokoman

                        i don't understand where is the problem
                        i'm actually doing that kind of config with haproxy
                        i have www on a ubuntu server, grafana on raspberry and owncloud on another virtual machine

                        www 172.17.0.100
                        grafana 192.168.10.202
                        cloud 172.17.0.99

                        the domain is always kiokoman.eu.org
                        haproxy is sending the request to the right server based on 'host start with'

                        and i have only one public ip 217.133.80.167

                        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                        Please do not use chat/PM to ask for help
                        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                        JKnottJ 1 Reply Last reply Reply Quote 0
                        • JKnottJ Offline
                          JKnott @kiokoman
                          last edited by

                          @kiokoman

                          I believe the original post was about having 2 independent servers, with different domain names on 1 IP address. That article I linked to describes how to do that.

                          PfSense running on Qotom mini PC
                          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                          UniFi AC-Lite access point

                          I haven't lost my mind. It's around here...somewhere...

                          1 Reply Last reply Reply Quote 0
                          • mohkhalifaM Offline
                            mohkhalifa
                            last edited by

                            Dear All,
                            Please note as I described, I have 2 servers (Citrix XenApp and VMware Horizon) and need to publish them to the internet. So, Is there a direct and easy way to do it ?
                            Thanks

                            1 Reply Last reply Reply Quote 0
                            • GertjanG Offline
                              Gertjan
                              last edited by Gertjan

                              @kiokoman mentionned your best choice :
                              HA-proxy.

                              It will receive traffic for both URLs - unpack the TLS traffic, and, upon detection of the corresponding URL used, send the traffic to the correct internal LA based server.
                              This will cover everything for you except the word 'easy' ....

                              See the YouTube>Netgate>haproxy video - and several others.

                              No "help me" PM's please. Use the forum, the community will thank you.
                              Edit : and where are the logs ??

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