0

I have two private websites that are running on different devices, that I want to use but aren't using a DNS, so the web pages that I am using are on the same Ip-Address. How can I get the contents of device b's webpage w/out contacting device A and vice versa. They are both port forwarded to Port 80.

I know this might be marked as duplicate from this post. The thing that is different is that I do not have a Domain Name compared to the other post.

Pius Lee
  • 3
  • 1
  • 1
    When you can't do name based virtual hosting (when you don't have a domain/DNS and don't want to add entries to a local [hosts file](https://en.wikipedia.org/wiki/Hosts_(file)) on the client and ip-based virtual hosting is not possible you can run sites on different ports and clients will need to use URL's like `http://ip-address:portnumber` – HBruijn Sep 17 '19 at 07:13

2 Answers2

0

Both devices would have to serve their pages from a different context.

E.g.:

x.x.x.x/devicea/index.html

x.x.x.x/deviceb/index.html

But even then, I don't know how you would be able to do the port forwarding.

So to do it, you would need to port forward to a front-end proxy (Apache, Nginx, HAProxy, etc) which would know how to route to the respective backends based on the URL context (/devicea, /deviceb).

In Apache, it's done with ProxyPass directive.

ETL
  • 6,443
  • 1
  • 26
  • 47
0

Get a domain name and DNS. This enables name based virtual hosting, easy TLS certs, changing the IP address in the future, and human readable names. Use subdomains if you only want to get one, so a.example.com and b.example.com. Both names can go to a proxy or load balancer to forward onto the web servers.

The one IP address problem goes away when you implement IPv6. Set static addresses like 2001:db8:2498:4479::a and 2001:db8:2498:4479::b, both listening on port 80.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32