Home

Awesome

Build Status

synapse-nginx

A config_generator for the Synapse framework that supports NGINX.

Installation

To install this plugin for Synapse, gem install it after synapse in your packaging setup.

$ gem install synapse --install-dir /opt/smartstack/synapse --no-ri --no-rdoc
$ gem install synapse-nginx --install-dir /opt/smartstack/synapse --no-ri --no-rdoc

Configuration

The NGINX plugin slots right into the standard synapse configuration file.

Top level config

The NGINX plugin requires a section to be added to the top level of your Synapse config. For example:

haproxy:
  # old config for haproxy
nginx:
  contexts:
    main: [
      'worker_processes 1',
      'pid /tmp/nginx.pid'
    ]
    events: [
      'worker_connections 1024'
    ]
  do_writes: false
  do_reloads: false

The top level nginx section of the config file. If provided, it must have a contexts top level key which contains a hash with the following two contexts defined:

The following options may be provided to control how nginx writes config:

You can control reloading with:

You can also provide:

Note that a non-default listen_address can be dangerous. If you configure an address:port combination that is already in use on the system, nginx will fail to start.

Service watcher config

Each service watcher may supply custom configuration that tells Synapse how to configure nginx for just that service.

This section is its own hash, which can contain the following keys: