The other day, I had everything running nice and smoothly on Nginx, and it was remarkably faster.
I was about to port another site over which was heavy on uploads. So, instead of using Flash and having to use a FlashSessionCookieMiddleware in Rails, I decided to use the nginx-upload-progress-module and use data straight back from the server to make a progress bar. This is where things started to get interesting…
I had originally installed Nginx via yum, so I had no ideas what modules they included in that particular distribution. After searching around for a while, I decided it would be best to just compile Nginx from source. I figured that this would give me the most up-to-date version, and I could add any additional modules I wanted.
I kept a copy of how yum configured Nginx when it installed to work from, and pretty much copied it verbatim and then added/removed modules as I went through.
--user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --without-http_fastcgi_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --add-module=/opt/nginx-upload-module --add-module=/opt/nginx-upload-progress --add-module=/opt/nginx-upstream-fair
This is where I ran into all kinds of problems. It would configure, but would exit out with errors when I tried to make. After quite a long time searching, I decided to just give it a shot leaving out
It worked! Everything is back up and running smoothly. Hopefully this option was worth it.
So far, this is my first knock against Nginx. Unlike Apache, you can’t dynamically include modules.