0

I have two device which can be accessed only using internal network.

To access it externally i have installed nginx in raspberry device and added a redirect within nginx like

location /device1
{
  return 301 http://192.168.0.1:80
}

Similarly device2 i have added and now i have used ngrok and exposed the localhost:80 externally.

Problem: If i am in the same network of device1 and device2 i am able to connect it.

If i change my network i am able to access the nginx default page.

Now If i append device1 it says page not found.

Solution Required:

How do i connect device1 and device2 from different network.?

Why is this required say for example i am running a application in amazon i want to connect to my internal device ip and access the data.

Alexander Tolkachev
  • 4,608
  • 3
  • 14
  • 23
Harsha
  • 101
  • `192.168.0.0/16` is a private IP address range. Only a device in the same network can access it. The `return` directive sends a HTTP redirect, i.e. asks the browser to retrieve the page. **nginx** should retrieve the page itself (`location /device1/ { proxy_pass http://192.168.0.1/; }`). – Piotr P. Karwasz Mar 06 '20 at 19:53
  • Thank you it worked – Harsha Mar 09 '20 at 06:16

0 Answers0