SOON GUYS.
NGINX IS SOON GONNA KILL APACHE. FINALLY.
https://w3techs.com/blog/entry/nginx_reaches_33_3_percent_web_server_market_share_while_apache_falls_below_50_percent
https://masto.quad.moe/media/xn4RWKdofSwmDLbjBz4
@quad if(when) nginx becomes the most used what difference would it have?
I mean what differences would it really have?
@virus Nginx is faster, more efficient resource usage and (most people at least) think the configuration is a lot easier.
@quad Is nginx so much better than apache?
@Pako Nginx is heaven man. I hated working with web servers when apache was a thing. Nginx is so much easier, faster and logical once you learn it.
Not to mention more performant in most tasks
@quad Couldn't you just use something like https://rocket.rs/ (no, I'm not a rust fanboy, just had that tab open right now) to host web stuff? Or is nginx on a lower level?
@Pako I'm not sure if you've heard but you're never supposed to take web apps like flask, sinatra, node, django, etc. and point them straight to the web. NEVER.
If you read the guides for any of them, they likely recommend putting it behind nginx and making it serve static files because it's both much safer and much faster
@chris @Pako It causes very little if you configure it properly. You'll need a couple more complex options to make that happen though.
If you also configure caching properly it'll typically perform better, even with compiled languages running behind, since nginx's logic for caching is honestly just pure insanity
@quad I feel betrayed now. Nobody ever told me anything like this lol.
I guess I'll learn nginx now.
@Pako
server {
listen 80;
server_name example.com;
location {
proxy_pass 127.0.0.1:<port>;
}
}
There. That's a functional config to proxy only requests to example.com to a running web application. Without https though.
@quad
Do you think that I can run something like this on my OPi0 24/7 without worrying about it dying?
@Pako What? nginx?
Of course, nginx uses like 4-8 MB of ram for most sites.
Heck even openings.moe that handles like 10TB/month only uses about 100MB per nginx install with in-memory cache key stores and all that fancy stuff.
@quad I'm more concerned about the CPU. It get's quite hot on the OPi0, even though I installed some small heatsink already, and I'm not sure how well it withstands a constant high temp.
@Pako nah, it'll be fine. i run nginx on my OPi Zero and nginx causes like 2-3% CPU usage tops. Granted that's not under heavy load
@quad I haven't actually used web apps made by others very often, but I've been developing one. Thanks for this post, might save my ass in the future being aware of this being a thing.
@neon It's not like it's the end of the world if you point a web app directly to the internet. It's just that every security guy on earth will cringe heavily at you
@quad Always nice to keep the cringe at bay. Though to be honest, it's impossible to keep security people cringe-free without being a security person full time yourself.
@neon Meh, it's mainly just because built-in web servers tend to have vulnerabilities more often than "proper" web servers.
And when they actually do have vulnerabilities it's way worse, because... well, the web server is IN your app. Aka they can mess with your DB and everything if the vulnerability is bad enough.
@quad Yeah, that's very sensible. Thing is, it hadn't even crossed my mind since I'm not very knowledgeable on anything server-side.
@neon It's basically just a case of "trust the guys who do this every single day for years on end instead of that little web server module you found online"
@quad finally! (not that there's anything wrong with apache)
@quad I try and use nginx as often as possible, but in some cases I'll use Apache. Nextcloud doesn't officially support nginx for example. I use to use lighttpd a lot as well but configuring was too temperamental for me.
@angristan @quad Yeah you can get it running but...
"This page covers example Nginx configurations to use with running an Nextcloud server. Note that Nginx is not officially supported." - https://docs.nextcloud.com/server/11/admin_manual/installation/nginx_examples.html
Guess I'm just a bit weird when it comes to my own personal files and the *ware I want to rely on to keep them safe.
@michael @angristan Most PHP apps just don't "officially" support nginx because they're not willing to convert their .htaccess into a couple nginx rewrite rules
@quad @angristan I never liked the idea of all or nothing .htaccess files anyway as far as security goes.
@michael I don't know about nextcloud, but I've always been running owncloud behind nginx, probably for about 3 years
@quad What with all those masto instances using nginx... ;-)
@quad ahh shit I don't even know how to use apache right, now I'm going to have to screw up NGINX installs?
@BeansWater nginx is child's play compared to apache though.
server {
listen 80;
server_name example.com;
location / {
proxy_pass 127.0.0.1:<port>;
}
}
There. That will proxy the domain example.com to a web app running locally. You can even fit the config in a Tweet.
@quad listen doesn't always allow you to just specify the ip tho. But way simpler than apache anyway
@quad Listen doesn't always allow you to just specify the port, sometimes needing the ip too. But way simpler than apache anyway
@Sava I have never encountered an issue where I needed the IP, unless I was behind a very odd DMZ setup where ports were managed by a watchguard firewall
@quad finally !
@quad this probably has a lot to do with CloudFlare, probably a lot of Apache hidden in the request somewhere
@quad
Note to self, Replace Nginx with Apache in all our deployments.
nginx still can't log an intact TLS cert CNAME if it would save it's life from annihilation.
@quad I like apache though.
Ironically this site runs on nginx but that's only out of sheer laziness.
@quad This is like taking a big steaming dump on the floor in Web 6.0 church though.
@quad Mid-2018?
@amrofnoc Probably. Maybe early 2018
WE JUST NEED ANOTHER YEAR OR SO