Search code examples
network-programmingweb-hostingself-hosting

Accessing local web server through subdomain in public web server


First of all, I have my own local webserver binded to my public IP, which I can access through internet from:

http://<my_public_ip>:<port>

On the other side, I have a purchased domain + hosting server, accessible from:

http://my_domain.com

What I want to achieve is to access my local server through a subdomain from my hosting server, in this way:

http://subdomain.my_domain.com  ==> (This pointing to http://<my_public_ip>:<port>)

Until now, the only way to I have been able to achieve this is by making a hard redirection, BUT:

  • This replaces my subdomain.my_domain.com name to my_public_ip:port, and I'd like to access using my domain name.
  • By requirements, I'm not able to upload my local webserver into the hosting server, so I need to access the local through the first one.

I'm not sure how to achieve this, the requirements or even if it's possible.

Could anyone point me to the way to make this happen?

Thank you all!


Solution

  • Ok, so I found the solution by myself.

    In the "DNS Zone Editor" from the hosting server we modify the A Record pointing the server domain to point into our local domain.