Favicon not showing up on deployed NextJS app

Hi, I have a NextJS app deployed with the favicon.ico placed in the public directory.
The favicon is showing in local dev and production builds but not on builds deployed on fly.io.

Are there any additional settings I should enable to get the favicon to show up?


Can you check the network pane in the developer tools of your browser to see if the favicon is loaded (or is attempted to get loaded) and perhaps 404’s?

I wonder if static files from the public dir aren’t getting handled from the web server setup from the Docker image that is used. If so, Another thing to check out are the docs on “statics” to tell Flys where to find static files

Seems like the favicon is not being loaded at all on the deployed website. The screenshot below shows the favicon being loaded in the local build but is missing on the deployed build.

In terms of statics I followed the instructions from @lubien from a separate thread and the statics section is currently as follows:

  guest_path = "/usr/app/.next/"
  url_prefix = "/static"

Might public/favicon.ico not be picked up by nextjs and built into the .next directory? But in that case the local build shouldn’t show the favicon but it does correctly.