I have a node/express/postgres app. I have the postgres db on one node and I plan to have several application nodes behind a separate load balancer so I can scale horizontally.
I set up my application nodes to each run nginx in front of the node app. So I have nginx listening on port 80 and forwarding the web requests to the node app on the same box which is listening on port 3000.
Then I was planning to put HAProxy in the front to handle the SSL termination and load balancing across the application nodes
My question: Is nginx obsolete in this case? Would it be better to just have HAProxy just forward to the application nodes on port 3000?
Are there any benefits of having nginx on each of the application nodes? I wont be serving any static files. My node app is a REST api that only returns JSON data. The node app doesn't ever render or serve any html.
I would just use HAProxy to proxy to the application nodes.
Having Nginx would be adding another potential point of failure and HAProxy has to health check both Nginx and node.js to ensure they are healthly.
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