A bug was reported where restarting a Discourse container during internet downtime causes the site to fail, due to nginx failing to resolve avatars.discourse.org in discourse.confcarbo. The issue arises because nginx crashes if the upstream host is unreachable, making the site inaccessible until internet is restored. A temporary workaround is to replace the proxy_pass line with https://localhost/. codinghorror suggested disabling external avatars for intranet setups, but carbo noted this isn’t helpful if the site can’t start. sam proposed serving letter avatars via the Rails app to handle DNS failures more gracefully, noting nginx caching would limit extra load codinghorrorsam. Matt_Campbell submitted two dependent PRs to fix the issue, which were later merged and confirmed fixed by sam via commit f04471e. The fix ensures Discourse remains functional even during internet outages.
It seems that if you have an intranet discourse site, even though it might have internet access, will no longer work if two factors come into play:
Your internet access is down (for whatever reason)
You decide to restart your discourse container during the same period.
Steps to reproduce.
Make a local Discourse install and configure it so that is properly setup
Unplug your network from the internet
Restart your Discourse container ./launcher stop app then ./launcher start app
Try to access the local Discourse site
After further checking.
The problem is caused by the nginx service not being able to find the host avatars.discourse.org found at line 220 of the discourse.conf file if the server has no internet access when trying to start. Once the internet connection is re-established nginx will start up. For that period of time your Discourse site will remain unusable. A workaround is to set line 220 of discourse.conf to:
I would like to change it so letter avatars are all served via the rails app which can be a lot smarter about dealing with a problem DNS entry an so on.
Just blanket failing to load NGINX cause avatars.discourse.org is not something we can allow.