-1

I'm trying to create a website, but when I port it forward using ngrok, I am not able to access it.

I am using a lamp server in Linux. I tried to access the website through my phone, but it shows this error and when I search using ngrok url it automatically changes the localhost in my phone browser.

Lioness100
  • 8,260
  • 6
  • 18
  • 49
David
  • 1
  • 2
  • Can you show what command you type to launch ngrok to share your site outside? – Pat. ANDRIA Oct 05 '20 at 06:30
  • I used the command "ngrok http 80" this command @pat. ANDRIA – David Oct 05 '20 at 06:32
  • Looks like you didn't install a webserver *on your phone* (as you're connecting to `localhost`). Note: localhost always refers to *the host that the browser is on*. Most likely you're not intending to install a webserver on your phone. – Olaf Kock Oct 05 '20 at 07:25
  • Does this answer your question? [How do you access a website running on localhost from iPhone browser](https://stackoverflow.com/questions/3132105/how-do-you-access-a-website-running-on-localhost-from-iphone-browser) – Olaf Kock Oct 05 '20 at 07:26
  • I have port forwarded my website in my pc using ngrok and when i use the ngrok port forwarded url in my mobile browser it gets replaced to localhost – David Oct 05 '20 at 07:37
  • I am not hosting my website from my phone i am using a linux pc to host my website using ngrok so i don't want to install a webserver in my phone – David Oct 05 '20 at 07:39

1 Answers1

0

Locally, I can access one of my local website using http://localhost. Now, I would like to share this website on the internet.

(By the way, this is not the way to deploy your site, only to share temporarily).

Using the command line, I use ngrok like this:

patou@pa-linux:~$ ./ngrok-stable-linux-amd64/ngrok http 80

This results in a display like the following:

enter image description here

What I see, from the image you uploaded, is that you try to access your website using http://localhost from the internet.

You do not access you site from outside as localhost but as the random name provided by ngrok. Here it is http://19cfca2ea9c5.ngrok.io. It will work better

Pat. ANDRIA
  • 2,330
  • 1
  • 13
  • 27