Earlier quoted context omitted.
Could I take your article and use it as a base for a Python version of that?
Feel free to use it. I wrote it to: A) Solidify what I had learned by putting it into writing. B) Help others avoid my dumb mistakes. So if it helps people I'm all for it. :)
Nginx for Developers: An Introduction
121–130 of 142 posts
Re: Nginx for Developers: An Introduction
#122It is easy to configure Nginx to check if the cached version of the requested URL exists and serve it. But i would like to know if the configuration can be extended bit further to serve the cached file only if is less than a few days old?
Re: Nginx for Developers: An Introduction
#123I like just keeping a single "etc/nginx/sites" folder, including "sites/*.ON" in my main nginx.conf and then appending .ON to the sites that are enabled: active.site.com.ON another.active.com.ON not.active.com
That's clever. Coming from Apache I was disappointed not to see something equivalent to: a2ensite (site)
Re: Nginx for Developers: An Introduction
#124Re: Nginx for Developers: An Introduction
#125Earlier quoted context omitted.
Today You Learn that is because the original package maintainer of the NginX package in Debian (and thus later, Ubuntu) simply copied the structure of the Apache package. It's most useless because there is no script to manage the sites available like with apache . I have been complaining about this for years! On FreeBSD and all my client's sites (whether they run Linux or what), I always set mine to include sites/*.c…
It's especially bizarre given how trivial such a script is - as far as I am aware, it's a glorified symlink-maker. Hrm, looking now, a2ensite is 340 lines long...
It is my experience from years of administration that `ln` and `rm` (or perhaps `mv`) are the only commands necessary to work with the directories without the scripts.
Re: Nginx for Developers: An Introduction
#126Earlier quoted context omitted.
What does visudo do that nano -w doesn't? I've never understood this properly.
Locks to only one editing user and confirms syntax is clean before saving. I'm not aware of nano enforcing correct sudoers syntax. Plus plenty of us don't like nano. man visudo for more info.
Re: Nginx for Developers: An Introduction
#127Earlier quoted context omitted.
I'm extremely biased as I have been using NginX for many years now; however, I've got to completely disagree with you. NginX's configuration is beautiful, elegant, and concise. It kicks the ever living crap out of configuring Apache or Lighttpd (the two other HTTPd's I have extensive experience with). It seems so strange, because it's different . NginX's configuration language is declarative . If is imperative and ac…
Yes, I linked to IfIsEvil. The fact that you need a page to document the horrible behavior because it's too late to fix it is a sign that something is very wrong with the config syntax.
NginX's configuration is declarative.
The reason the imperative if was given powers beyond its means was because people clamored for the feature.
The reason it's still there is because removing it would break some working configurations that use if.
If you don't have experience with declarative programming and you think in terms of imperative programming, it might seem "horrible behavior", but actually, it's what is to be expected from mixing the two paradigms in the way it is being mixed.
The real wart is under the hood where-in location based if's are converted to sub-locations. This is where many problems related to IfIsEvil stem from.
Re: Nginx for Developers: An Introduction
#128Re: Nginx for Developers: An Introduction
#129If you like this article, I wrote a similar one called Devops for Dummies. http://tech.pro/tutorial/1335/devops-for-dummies-vps-configu... It teaches you how to setup a DigitalOcean (or any other) VPS from scratch to host N amount of Rails applications using Nginx and Passenger. It took me some time to get things working properly and I distilled it into this short article that holds your hand and takes you from A to…
Re: Nginx for Developers: An Introduction
#130Earlier quoted context omitted.
Locks to only one editing user and confirms syntax is clean before saving. I'm not aware of nano enforcing correct sudoers syntax. Plus plenty of us don't like nano. man visudo for more info.
visudo, like vipasswd or crontab -e and other commands, respect the EDITOR environmental variable, so you can edit these files with whatever editor you prefer, while maintaining their protections.