Hi!
My website uses version 2.9 of discourse. For some reason, I had to use double nginx for discourse. I deployed two discourse web_only container nodes and used an nginx to proxy in front of them. My system architecture diagram:
I was confused when my custom nginx proxy two web_only container nodes and randomly distributed requests to any web_only node, my discourse website sometimes reported errors: Could not find module ‘handlebars’ imported from’ discurse-common /lib/raw-handlebars’, this time the browser visits the site blank screen. But when I used custom nginx to forward all requests to only one of the web_only nodes, this error does not occur. I searched for this problem, there were some commits before to solve this same error, I confirmed that my version contains those commit code.
By the way, share a problem where using double nginx causes can’t get the real user IP address.
This is because my custom nginx enables X-Forwarded-For header field to get client IP address, but does not disenable X-Forwarded-For of discourse’s nginx. Causes the custom nginx X-Forwarded-For configuration to be overwritten by discourse’s nginx
And it doesn’t matter which one you use? And they are running the same image? That is perplexing.
The only advantage I can see to running two containers like that on the same host is to make it possible to do zero-downtime upgrades. Since you’re not upgrading very often, it seems that you’ve got unnecessary complexity.
You need sometihng like this in your web_only.yml:
Yes, it doesn’t matter which one use. They are running the same web_only image. I will continue to look for problems using safe-mode and if there are any conclusions I will report back here.
Sorry for the misunderstanding in my system architecture diagram, I used a different machine to deploy web_only.The reason why I use double web_only is that my web_only container once crashed due to too many connections, but I did not find out the reason at that time. So I tried to use double web_only to avoid the same problem again.
Thanks,this helped me solve the problem of getting the real user ip