4 ms·
It may sound trivial, but the thing I appreciate most about Nginx is its lightweight config file syntax. It's very easy to glance over and see what's been set
by jbarham 15y ago
It may sound trivial, but the thing I appreciate most about Nginx is its lightweight config file syntax.
It's very easy to glance over and see what's been set up compared to Apache's verbose pseudo-XML syntax which is about the worst syntax you can come up with: the verbosity of XML but without the benefit of being able to generate or parse it using standard XML tools!
- antihero 15y agoYep, it's utterly dire. People bitch about X11 config files, but this is in many ways worse because it pretends to be XML. It'd be nice to submit a patch for Apache so it can read YAML, XML, and JSON based configuration. Or even just some sort of consistent fucking format, so we can generate configs for a bunch of servers with lxml or something. The other thing that fucks me off is that the server will reboot happily and fail to start without having first checked that it can start, and configtest doesn't pick up things like directories being missing.
- gpmcadam 15y ago> and configtest doesn't pick up things like directories being missing. Uh, last time I checked (Apache 2.2.17 (Ubuntu)) it did. # apache2ctl configtest Warning: DocumentRoot [/dev/null/doesnt/even/exist] does not exist
- benjiweber 15y agoNginx config gets pretty hairy as soon as you try and do anything unforseen. Just read http://wiki.nginx.org/IfIsEvil http://wiki.nginx.org/IfIsEvil for a start. Lots of things can only be done with ifs (unless you write a custom module) The "What to do instead" doesn't work for things that aren't simple rewrite rules. There are seemingly arbitrary rules for what contexts you can have conditionals in, what commands can be in conditionals. There is no support for ands, ors, or nested ifs.
- justincormack 15y agoDon't use if. Use the Lua module if you need to do complex stuff, or another one.
- drivebyacct2 15y agoI used Apache for years and then switched to Nginx and used it for about a year and a half. I've been bitten by all sorts of weirdness just trying to figure out how to do very basic things in Nginx, where configuration bits go and weird idiosyncrasies of the syntax and how it's parsed.
- mfjordvald 15y agoAny specific examples?
- rogerbinns 15y agoThe biggest drawback to nginx is that changing modules requires a recompile. This is especially annoying as nginx doesn't support HTTP chunked uploads (downloads are fine). Chunked uploads are used when you don't know the size of something in advance. There is a module that hacks a solution, but very annoying to have to do the recompile.