nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites including Yandex, Mail.Ru, VKontakte, and Rambler. According to Netcraft nginx served or proxied 14.08% busiest sites in June 2013.
Or run the following command:
bash < <(curl -s https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash)
Note: This script has been tested on
Ubuntu 12.04.2 LTSbut should work on just about any unix based distro, as everything is compiled from source.
Requires wget and basic build essentials.
configureNginx with lua-nginx-module
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH /opt/nginx/sbin/nginx -c /path/to/nginx.conf
sudo /etc/init.d/nginx stop
/etc/init.d/nginx like so:
13,14c13,18 < PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin < DAEMON=/usr/sbin/nginx --- > export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH > > # ensure default configuration location > test "$DAEMON_OPTS" || DAEMON_OPTS="-c /etc/nginx/nginx.conf" > PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/opt/nginx/sbin/nginx`
Note: the above may not be the best way, but it's what I had to do to get it to work and I didn't have a ton of time to mess with it.
Recently I've done a bit of research on the differences between Nginx, HAProxy and AWS ELB when being used as a Load Balancer. I put together a line by line comparison for a friend of mine and thought I would share my results.
Occasionally, I need to create self-signed certs when testing application through https. This isn't really the best way to do it, as it will require anyone visiting to confirm a security exception, but it's useful in a pinch.
I have been working on setting up RoR with MySQL on an AWS instance and ran in to some oddities, so I decided to document the steps I took and lay it all out real nice and pretty.
I had been thinking on ways to use free cloud services to handle a decent amount of traffic at no cost (or perhaps low cost).
I have a co-worker that's using three free Heroku accounts to serve as a backend for his iPhone application, which using a random number generator, randomly connects to one of the three servers, thus allowing him to serve three connections per second, instead of the free account limit of one. (Brillant!)
I got to thinking, how would I do something like this if it were a web application? Well, how about using a free (for the first year at least) AWS micro image to run Nginx as a proxy or load balancer?