Skip to content

Instantly share code, notes, and snippets.

@jmontrose
Forked from ejholmes/build_nginx.sh
Last active December 26, 2015 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmontrose/7122525 to your computer and use it in GitHub Desktop.
Save jmontrose/7122525 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Run with:
# $ heroku config:set AWS_S3_BUCKET=public-bucket
# $ heroku run 'curl https://gist.github.com/ejholmes/7120501/raw/build_nginx.sh | sh'
NGINX_VERSION=1.5.2
PCRE_VERSION=8.21
nginx_tarball_url=http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
pcre_tarball_url=http://garr.dl.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.bz2
echo "Downloading $nginx_tarball_url"
curl $nginx_tarball_url | tar xzf -
cd nginx-${NGINX_VERSION}
echo "Downloading $pcre_tarball_url"
curl $pcre_tarball_url | tar xjf -
./configure --with-http_ssl_module --with-http_gzip_static_module --with-pcre=pcre-${PCRE_VERSION} --prefix=$HOME && make install
cd $HOME/sbin
curl \
-F "key=nginx" \
-F "acl=public-read" \
-F "Content-Type=application/octet-stream" \
-F "file=@nginx" \
http://${AWS_S3_BUCKET}.s3.amazonaws.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment