Today I needed to update my nginx server to support serving of static gzipped asset files alongside Passenger (Rails 3.1 asset pipeline – server configuration). My install was already a bit of a hack after trying various ways to originally get it installed. This update needed the whole thing to be re-built from source so I decided to get the latest source and write myself some notes so that it won’t be so hard next time.
Inspiration came from this excellent blog post: How to compile your own Nginx and Passenger
Based on that blog post I just downloaded the source from nginx then wrote myself this little shell script.
— build.sh —
# Load RVM Functions into shell
[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
rvm use ree
echo passenger gem is installed in:
export PASSENGER_NGINX_DIR=`passenger-config --root`/ext/nginx
echo Building $NGINX_SRC_DIR
echo All done. Just edit /etc/nginx/nginx.conf to ensure it is
echo picking up correct version of Passenger
Next time all I need to do is edit this script.