V
V
Vasily Serpokryl2016-05-07 19:25:47
Nginx
Vasily Serpokryl, 2016-05-07 19:25:47

Why is the icon downloaded to my computer when opening myhost.ru/favicon.ico?

Raised the nginx server + node js connected ssl. Static gives the norms, but for some reason the favicon shakes, I can’t understand anything. Those. myhost.ru/1.png - gives the rules, myhost.ru/favicon.ico - downloads the icon ... Naturally, in the browser, it is not displayed as a site icon. As soon as I didn’t try to do this, as a result, now there is a separate location on the favour.

location = /favicon.ico {
  alias /app/static/favicon.ico;
}

Solution:
All files had incorrect mime types, due to the wrong path to the mime.types file. Set
your path to this file in the http directive
http {
    include /usr/local/etc/nginx/mime.types;

    # configuration... 
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton B, 2016-05-07
@graf_777_gos

Perhaps the problem is in the mime type that you have for ico in nginx is not registered

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question