Heroku buildpack for running NGINX in front of a static site.
This buildpack is commonly added on top of an existing Heroku buildpack. For example, if you have a site that needs to be built using npm, add this buildpack after the heroku/nodejs buildpack.
heroku buildpacks:add https://github.com/jcomo/static-site-buildpack.git
On the next deploy NGINX will be built and deployed alongside your static site.
By default the static root is set as
www/data but can be configured.
NGINX_VERSION1.11.3 The version of NGINX to build. To change, the cache must be purged first
NGINX_ROOTwww/data The directory serving the static site
NGINX_FORCE_SSLfalse Forces requests to https if enabled
NGINX_BUILD_SCRIPTbin/build_site.sh The location of the script that will build the site
NGINX_NOCACHE_FILETYPES(none) The file extensions to not put under cache control (useful for development servers)
NGINX_HTPASSWD(none) The location of the htpasswd file to protect the site. Will be unprotected if not set
NGINX_WORKERS2 The number of NGINX workers (don't change without good reason)
Copy the snippet above into CLI.