2

Below is the URL. Below url is working for only localhost.

curl http://test.redzilla.localhost:3000/

I want to know how to get access above URL from outside the server.

I tried it by doing like below.

curl http://test.redzilla.11.75.65.34:3000/

after executing the above code below error was triggered.

curl: (6) Could not resolve host: test.redzilla.11.75.65.34

I just want a way to access above URL from outside the server. There is multiple instances. each instance have a URL like above. Instances count dynamically changed.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • I'd start by just trying the numeric IP only. It may not be able resolve the name to IP. Can you ping the URL? Do you require a proxy? – Acroyear Sep 13 '19 at 16:31
  • I can add proxy for this URL. Then it will working for only this URL. the first part of this URL ( "test") is dynamically changed. The instance is identified by first part for this url. Can we create common proxy like below?. http://*.redzilla.13.75.65.67:3000/ – Stelan Briyan Simonsz Sep 13 '19 at 16:38
  • On the remote system add an entry in `/etc/hosts`, mapping the public ip of you machine to the domain, e.g `11.75.65.34 test.redzilla.localhost`. – Cyclonecode Sep 13 '19 at 16:56
  • I would suggest putting the curl call in a shell script where you can dynamically change the proxy based on the host you are on. – Acroyear Sep 13 '19 at 17:02

1 Answers1

1

You need DNS to resolve the hostname. You can use a free wild card DNS service like xip.io:

curl http://test.redzilla.11.75.65.34.xip.io:3000/
BMitch
  • 231,797
  • 42
  • 475
  • 450
  • Thank you for the help. I can access now for the sub domain URL. but I had another issue with NGINX location tag. If you have any idea please let me know [link](https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve) – Stelan Briyan Simonsz Sep 14 '19 at 16:15