GithubHelp home page GithubHelp logo

ansible-nginx-letsencrypt's Introduction

ansible-nginx-letsencrypt

Simple role to install nginx with let's encrypt on debian and configuring a set of reverse proxies.

The roles allows the following configurations:

  • multiple backends in a single server
  • multiple backends in multiple servers

For the let's encrypt certificate there are two possibilities:

  • one combined cert that is used in all of the servers
  • a single cert for each server

The role defaults to using one combined certificate for all the servers. This behaviour can be changed by setting nginx_single_cert: false. The nginx host marked default: true will get a 'default' flag.

Example set of variables:

  nginx_letsencrypt_email: "[email protected]"
  nginx_hosts: [
    {
      default: true,
      domain_name: "abcde.example.com",
      reverse_hosts: [ 
        {
          protocol: "http",
          path: "",
          host: "127.0.0.1",
          port: "8080"
        },
        {
          protocol: "http",
          path: "/foo",
          host: "127.0.0.1",
          port: "8090"
        }
      ]
    },
    {
      default: false,
      domain_name: "edcba.example.com",
      reverse_hosts: [ 
        {
          protocol: "http",
          path: "/foobar",
          host: "127.0.0.1",
          port: "9000"
        }
      ]
    }
  ]

If for a server there are no reverse_hosts defined, a regular nginx server with the document root being in /var/www/{{ domain_name}} is configured.

Basic Auth

If basic auth is wanted for the server, adding the users variable will enable this:

 nginx_letsencrypt_email: "[email protected]"
  nginx_hosts: [
    {
      default: true,
      domain_name: "abcde.example.com",
      users: [ "username:password", "seconduser:password" ],
      reverse_hosts: [ 
        {
          protocol: "http",
          path: "",
          host: "127.0.0.1",
          port: "8080"
        },
        {
          protocol: "http",
          path: "/foo",
          host: "127.0.0.1",
          port: "8090"
        }
      ]
    }
 ]

ansible-nginx-letsencrypt's People

Contributors

fkr avatar

Watchers

 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.