0

I am running a localhost service on my VPS.

When i start the service, this is what i get:

Navigate to https://127.0.0.1:7443 in a browser

The problem with this is that i can't open it in my browser because it's a VPS.

I have tried running ngrok, but it says connection to localhost failed.

Is there a way i can forward it to the IP address of the same VPS the localhost is running? For example i open the browser and i enter my servers IP?

  • Can you clarify what you mean by a "localhost" service? The message you see indicates that the service is not bound to an external interface, you'll need to update it's config somehow. – shearn89 Sep 23 '21 at 10:51

2 Answers2

0

Do you already tried to access the port with the IP of the VPS rather than using localhost, because some application said in the console go to localhost but listen on all interfaces.

An alternative if the service only listens on localhost and you have ssh access to the VPS you can port forward the localhost port of you VPS to your local machine.

ssh user@vpsIP -L 7443:localhost:7443

explanation of -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT the first square brackets is optional if you want to specify where to listen on your machine, default is all interfaces

Vaibhav Panmand
  • 959
  • 5
  • 17
0

Start the web server listening on remote addresses, and access over the internet.

Read the documentation of the web server in question for how to do that. Prefer production deployment scenarios, with a known web server. Possibly insert a load balancer or other utility proxy in the middle.

Toy servers for development purposes are not hardened or performant enough for operational use. And might listen on loopback addresses only.

Get a domain name for this thing as well. Easier to issue TLS certs for a name, and also easier for humans to remember.

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