8

On running ngrok and going to the suggested url, i get GET /favicon.icon 404 error in ngrok.

In which folder does ngrok search for the favicon.ico file ?

How do i fix this ?

Very new to ngrok. Do help me out

Thanks in advance

dreamer
  • 901
  • 2
  • 15
  • 38

2 Answers2

14

I ran into a similar problem with URIs from ngrok being served as 404s.

I have a local Apache, PHP and MySQL stack setup on macOS using *.dev domains.

So in my case, I needed to set the host-header option in ngrok to match the hostname of the virtual host Apache was configured for.

Here's the relevant part of my Apache virtual host configuration:

<VirtualHost *:80>
    ServerName example.dev
    ServerAlias www.example.dev
    ...
    UseCanonicalName Off
</VirtualHost>

The necessary ngrok arguments to tunnel requests to my private development domain were:

$ ngrok http example.dev:80 -host-header=example.dev

rjb
  • 9,036
  • 2
  • 44
  • 49
  • Works form me with IIS and localhost (https://localhost/api etc): PS: .\ngrok.exe http https://localhost -host-header=localhost – Artem A Feb 27 '20 at 15:07
2

What ngrok do is,make tunnels to localhost.That allows you tunnel requests from Internet to your local machine.

You can see following details after running : ngrok http 8888

Tunnel Status

online                                            
Version                       2.0.19/2.0.19                                     
Web Interface                 http://127.0.0.1:4040 
Forwarding                    http://299954c1.ngrok.io -> localhost:8888

Now all the data intended for 'http://299954c1.ngrok.io' url which is publically accessible will come to your local machine at port 8888

You need to have some server running on your local machine at port 8888 which can serve 'favicon.icon' static file

If you are able to get icon by hitting : localhost:8888/favicon.icon in your browser, You will surely get it from http://299954c1.ngrok.io/favicon.icon

Cyril Mestrom
  • 6,042
  • 4
  • 19
  • 27
Piyush Sagar
  • 2,931
  • 23
  • 26