Skip to main content

A Buildout recipe to install and configure Nginx with Anaconda.

Project description

Introduction

birdhousebuilder.recipe.nginx is a Buildout recipe to install Nginx from an Anaconda channel and to deploy a site configuration for your application.

Birdhousebuilder recipes are used to build Web Processing Service components (Phoenix, Malleefowl, Nighthawk, FlyingPigeon, …) of the ClimDaPs project. All Birdhousebuilder recipes need an existing Anaconda installation.

Usage

The recipe requires that Anaconda is already installed. It assumes that Anaconda is installed at the default location in your home directory ~/anaconda. Otherwise you need to set the Buildout option anaconda-home.

The recipe will install the nginx package from a conda channel and deploy a Nginx site configuration for your application. The configuration will be deployed in ~/anaconda/etc/nginx/conf.d/myapp.conf. Nginx can be started with ~/anaconda/etc/init.d/nginx start.

The recipe depends on birdhousebuilder.recipe.conda.

Supported options

This recipe supports the following options:

anaconda-home

Buildout option with the root folder of the Anaconda installation. Default: $HOME/anaconda.

input

The path to a Mako template with a Nginx configuration for your application.

sites

The name of your application.

All additional options can be used as parameters in your Nginx site configuration. The anaconda-home Path is available as prefix parameter.

Example usage

The following example buildout.cfg installs Nginx with a site configuration for myapp:

[buildout]
parts = myapp_nginx

anaconda-home = /home/myself/anaconda

[myapp_nginx]
recipe = birdhousebuilder.recipe.nginx
input = ${buildout:directory}/templates/myapp_nginx.conf
sites = myapp

hostname =  localhost
port = 8081

An example Mako template for your Nginx configuration could look like this:

upstream myapp {
  server unix:///tmp/myapp.socket fail_timeout=0;
}

server {
  listen ${port};
  server_name ${hostname};

  root ${prefix}/var/www;
  index index.html index.htm;

  location / {
    # checks for static file, if not found proxy to app
    try_files $uri @proxy_to_phoenix;
  }

  location @proxy_to_phoenix {
      proxy_pass http://myapp;
  }
}

Authors

Carsten Ehbrecht ehbrecht at dkrz.de

Changes

0.1.3 (2014-08-26)

  • Fixed proxy config for wpsoutputs.

  • Using proxy-enabled buildout option.

  • options master and superuser_enabled added.

0.1.2 (2014-08-01)

  • Updated documentation.

0.1.1 (2014-07-24)

  • Added start-stop script for nginx.

  • Generates self-signed certificate for https.

0.1.0 (2014-07-10)

Initial Release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

birdhousebuilder.recipe.nginx-0.1.3.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file birdhousebuilder.recipe.nginx-0.1.3.tar.gz.

File metadata

File hashes

Hashes for birdhousebuilder.recipe.nginx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 47a7b52d4bf6e299214ad2a5c46ef269a2da112451f5a7b0986838e1eeb8e087
MD5 9dc11e4d4dca06f540847d02b8adf18c
BLAKE2b-256 7f7d8cd7516ea90dd8c0410d6febd234bceaaa069820b22b285b0676448d3e9f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page