Code Monkey home page Code Monkey logo

heroku-buildpack-nginx's Introduction

Heroku buildpack: nginx

This is a Heroku buildpack for nginx.

Usage

Example usage:

$ ls -R *
conf:
mime.types     nginx.conf.erb

html:
index.html

$ heroku create --stack cedar --buildpack http://github.com/essh/heroku-buildpack-nginx.git
...

$ git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Nginx app detected
-----> Fetching nginx binaries
-----> Vendoring nginx 1.0.11
...

The buildpack will detect your app as nginx if it has the file nginx.conf.erb in the conf directory. You must define all listen directives as listen <%= ENV['PORT'] %>; and also include daemon off; in order for this buildpack to work correctly.

As an alternative to the above instructions you may wish to investigate heroku-buildpack-multi in order to support more complex use-cases such as compiling a static site that is served by nginx or placing nginx in front of app server processes.

Hacking

To modify this buildpack, fork it on Github. Push up changes to your fork, then create a test app with --buildpack <your-github-url> and push to it.

To change the vendored binaries for nginx use the helper script in the support/ subdirectory. You may wish to edit the helper script to modify the nginx build options to suit your needs. You'll need an S3-enabled AWS account and a bucket to store your binaries in.

For example, you can change the vendored version of nginx to 1.0.12.

First you'll need to build a Heroku-compatible version of nginx:

$  export AWS_ID=xxx AWS_SECRET=yyy S3_BUCKET=zzz
$ s3 create $S3_BUCKET
$ support/package_nginx 1.0.12 8.30

The first argument to the package_nginx script is the nginx version. The second argument is the version of PCRE to compile nginx against.

Open bin/compile in your editor, and change the following lines:

NGINX_VERSION="1.0.12"
S3_BUCKET=zzz

Commit and push the changes to your buildpack to your Github fork, then push your sample app to Heroku to test. You should see:

-----> Vendoring nginx 1.0.12

heroku-buildpack-nginx's People

Contributors

mantrastar avatar marcusdalgren avatar essh avatar

Stargazers

Julio Arias avatar

Watchers

 avatar James Cloos avatar

Forkers

vadzappa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.