2

I would like to explain the scenario that we have then ask the question:

we have the domain:

  • www.example.com

and the following sub domains:

  • forum.example.com
  • portal.example.com
  • crm.example.com

and the following applications which are hosted on separate servers:

  • forum - Server IP: 1.1.1.1, port: 1010
  • portal - Server IP: 2.2.2.2, port: 2020
  • crm - Server IP: 3.3.3.3, port: 3030

all the server are running behind a firewall

on the other hand we have only one public IP address:

10.10.10.10

so to link the local servers with the public ip we can create virtual hosting entries in the firewall and create public ports as following:

  • 10.10.10.10:1010 will point to 1.1.1.1:1010
  • 10.10.10.10:2020 will point to 2.2.2.2:2020
  • 10.10.10.10:3030 will point to 3.3.3.3:3030

then we will configure the following A NAME record in the DNS ZONE:

  • www.example.com - 10.10.10.10

so to go to the forum application, the user have to type:

  • www.example.com:1010

and so on:

  • www.example.com:2020 for portal
  • www.example.com:3030 for crm

now, instead of using the port number we would like to use the sub domain, for example, if the user want to go to the forum he will just type:

  • forum.example.com

and same for the other applications.

Is this possible to be done without purchasing new public IP addresses for each application?

Sorry for the long post. Thanks

Eng.Ya553r
  • 23
  • 1
  • 1
  • 3
  • 2
    You need a reverse proxy/lid balancer in front of the 3 servers that will direct traffic to the correct server based on the requested URL. – Appleoddity Dec 13 '17 at 13:24
  • Thank you for your feedback, would you please provide more details. – Eng.Ya553r Dec 13 '17 at 15:56
  • 2
    ServerFault is for helping in concrete problem situations, not as a place to give step-by-step instructions. Please do your own research on reverse proxying and if something is unclear, open another question on the subject. – Tero Kilkanen Dec 14 '17 at 22:12
  • Does this answer your question? [What is a Reverse Proxy?](https://serverfault.com/questions/8654/what-is-a-reverse-proxy) – vidarlo Apr 29 '23 at 21:23

1 Answers1

1

I take it your various applications are available via HTTP/HTTPS. In that case you have a couple of common options.

  • Have your web server proxy the other three sub-domains (www is also a subdomain) for the services.
  • Install a HTTP/HTTPS proxy to proxy all for subdomains (as well as the domain).

You can start with one option and change to the other later. Some application containers have plugins for web servers that add proxy headers specific to the container.

If you are using HTTPS. you will need a subject alternate name for each domain on the certificate. Alternatively, you can use SNI in the front-end (web server or proxy) to provide the correct certificate to the client (SNI capable clients only).

BillThor
  • 27,737
  • 3
  • 37
  • 69