4 ms·
Nginx is your best friend. I always have an Nginx proxy in front of services. Whether it's Go, Ruby or Node (or Docker)
by avitzurel 10y ago
Nginx is your best friend.
I always have an Nginx proxy in front of services. Whether it's Go, Ruby or Node (or Docker)
- akerl_ 10y agoCan you clarify why?
- logn 10y agoNot OP but if you want an app in production then you want to be able to configure the http parts and script with command line tools. And if you start doing all that then you're basically reinventing nginx. Even comparing Java, nginx still has nicer http features, such as reloading ssl certs and config without dropping connections.
- avitzurel 10y ago@logn clarified pretty well. Anything you do in your service other than your own business logic is reinventing the wheel (I mean in the HTTP level), and not doing it so well as someone before you (nginx/HaProxy etc...). This is a generalization of course, but my strategy of putting Nginx in front of everything didn't fail me so far.
- Can_Not 10y agoYou say strategy, I think you meant well established, battle tested and proven, industry standard best practice.
- edoceo 10y agoAnd Apache/PHP and Tomcat and all the things. Nginx as the Frontline has been my policy since forever. For resilience, HA, proxy routing, static files, masking backend errors, caching. Does HTTP+S and 2 and Websocket so nicely. Nginx all the things.
- btmiller 10y agoOne thing I've found lacking in Nginx is active health checks. I know this is a feature in Nginx Plus, but I'm curious to know if there are any elegant open source solutions for this.
- brazzledazzle 10y agoHAProxy does health checks. Might not be worth adding that inline for your needs but it does a good job of load balancing.