Coder Social home page Coder Social logo

ennea-webapp-nginx's Introduction

ennea-webapp-nginx

Automatically create nginx site configuration files based on consul service availability

This is a component of EnneaHost, but was designed to be independently useful

Usage

  • Register your service in the consul service catalog. We recommend registrator to do this automatically.

  • Create a key in Consul named webapp/<service-name>. The value can be anything, it's currently not used.

  • Ennea-webapp-nginx will create an nginx configuration file /etc/nginx/sites-enabled/<service-name>.conf to proxy the service and reload nginx.

Configuration

You can set the following keys in consul:

  • <hostname>/public_ip. If set, your service will be available on http://<service>.<public_ip>.xip.io. This is very useful for development environments.
  • <service-name>/cname. The DNS address that your site should be available at. Set's the server_name directive in nginx.
  • <service-name>/public. The location of any static files that nginx should service directly. This is the root directive in nginx.

You can also directly modify the file webapp-nginx.outer-ctmpl. If you make useful modifications to this file, pull requests are always welcome.

Prerequisites

Installation

Run install.sh as root. There are two configuration variables that you can pass to the install script if you wish to modify the defaults

  • TEMPLATE_DIR: default $(pwd)/templates. The directory to hold intermediate template files.
  • CONSUL_TEMPLATE_EXEC: default $(which consul-template) -consul consul.service.consul:8500. consul-template invocation
  • NGINX_SITES_DIR: default /etc/nginx/sites-enabled
$ sudo TEMPLATE_DIR=/var/ennea-templates ./install.sh

ennea-webapp-nginx's People

Contributors

bryanlarsen avatar

Stargazers

Keith Chambers avatar

Watchers

 avatar James Cloos avatar Keith Chambers avatar  avatar

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.