I am looking to set the icons for a domain on an nginx server I have configured. There are many different urls on this domain which will need to display the same favicon / icon no matter what the url.
I am looking for some advice in implementation.
Later, both Firefox and Safari added PNG support for Favicons, marking the first major change to the Favicon format.
A favicon can actually be either a PNG, GIF, or ICO file. However, ICO files are typically used more than others as the file size is smaller and it is supported in all major browsers. PNGs are used more commonly for IOS, Android, and Windows 10 devices.
The optimal size for favicons is 16x16 pixels. That's how they appear in browser tabs, address bars, and bookmark lists. Ideally however, you'll create your favicon in multiple sizes. That way you'll see properly scaled versions on larger screens rather than the 16x16 version stretched out.
Today, favicon. ico still has widespread support across a variety of browsers. However, more contemporary websites tend to use favicon.
If you would like to have all (sub)domains on a server have the same favicon, you can enter this in the server configuration:
location ~ /(favicon.ico|apple-touch-icon.png)$ {
root /var/www/default;
}
And just place the icons in the above folder.
Hope that helps, cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With