Today I tried adding a second server to host one of our discourse instances. The container is configured to use an external redis, postgres, and storage servers - its web-app only. Thus far we’ve been running the single server sites behind HAProxy without issues. When running with 2 servers behind HAProxy we see quite a few 404s from nginx for JS files. Removing either server from HAproxy stops the problem. The URLs for the files that 404 appear to be identical so I’m stumped as to why they wouldn’t be served by either server.
There are no overrides in the Developer settings. We’re running 2.4.3 stable.
Besides adding and removing backends in Haproxy what have you done to test it?
Does your Haproxy config do random backends or affinity? Is the 404 logged by Haproxy? Is the 404 logged by nginx? Is it the first or second backend that errors? Does your site require login? Can you reproduce the errors when connecting to nginx directly from behind the proxy server? Do the files being requested exist on disk? Is it all JS or just specific ones?