How to redirect subdomain to fixed IP on specific port

2

I'm using a web application that runs on port 8180 and would like to redirect my subdomain to the IP of my server on port 8180. In DNS zones, I created an A-type entry, but I can only tell the IP, and the port is not working.

How to do this redirection, that is, when typing service.meusite.com.br it will redirect to my server on port 8180 getting something like 123.45.678.90:8180 ?

    
asked by anonymous 20.05.2015 / 21:45

1 answer

3

This you want to do, can not do with DNS only . DNS resolves only addresses, not ports. To redirect HTTP to another port, you need an HTTP server. We have two alternatives.

If the subdomain address (123.45.678.90) has port 80 free (which I do not believe is the case, otherwise you would not want to use port 8180), you should put a Web server serving port 80 and redirecting any request to link .

If the subdomain address (123.45.678.90) is already using port 80 for the primary domain (I believe this is the case), you must enable the use of Virtual Host on the port 80 server because there a single server Web can serve multiple domains at the same address. In a virtual host you put the domain, in the other virtual host the subdomain that redirects everything to: 8180.

The virtual host configuration differs depending on the web server you are using, so I will not go into details.

    
20.05.2015 / 22:15