3 ms·
You misunderstand. The norm today is to have a library/framework which handles those things, instead of a separate binary running on the system which your code
by brundolf 5y ago
You misunderstand. The norm today is to have a library/framework which handles those things, instead of a separate binary running on the system which your code talks to. It's roughly the same level of abstraction, just a different programming model.
I guess in some cases like Node and Python(?) you're technically talking to an underlying server written in native code which ends up working kind of the same way (though I'm not sure if it lives in a separate process). But still, the programming model exposed to the application programmer is "Download Express/Flask, define some routes, then call a function to tell the server to start up and listen on some port". I'm just musing on the mindset shift that's happened.
- TheOtherHobbes 5y agoThe conceptual difference is that Flask etc are task oriented and Nginx is technology oriented. Specifically it's a kind of expanded instantiation of the entire HTTP request cycle with hooks that allow some of the sub-events to be customised. This sounds like a good thing, but is actually a problem in practice. Nginx is one of the few pieces of software that has literally enraged me. The configuration process is so obtuse and full of random gotchas where it does what it wants for no obvious reason - with minimal docs - that it's very hard to get it working the way you want to. One obvious example is that index can trigger an internal rewrite. So you set up a location and Nginx will find your path and index correctly - and then it throws it away and decides to use a different location. Which most likely gets you a 404. You can stop this if you know the magic words, and no doubt there is a Very Good Reason for it. But intuitive it isn't.
- nofunsir 5y agoI’d be wary as a “young dev” to claim he misunderstands. It will become very obvious to you later why Apache and Nginx exist. A very very small example is: So you want multiple “apps” on the same server? How ya gonna bind to the same port, 443? How are you going to play nice with other apps? How are you going to keep up with security loopholes? Does your app and every other app need access to the private key? There hasn’t been a mindset shift. You simply haven’t experienced the whole set. Even super large apps such as Atlassian’s suite rely largely on a reverse proxy being in place of you don’t want to tell your users to use some random port. These web servers are fast and powerful. How do you think load balancing is accomplished?
- brundolf 5y ago> I’d be wary as a “young dev” to claim he misunderstands. I only meant they misunderstand what I myself am saying. There's no need to get combative. > Even super large apps such as Atlassian’s suite rely largely on a reverse proxy > How do you think load balancing is accomplished? If you read my original comment, I specifically carved out these cases as not being what I'm talking about: > Of course nginx is more than that- in my limited experience I mostly see it used as a static file server and/or reverse-proxy and/or load balancer.