Git Product home page Git Product logo

nginx's Introduction

nginx

wercker status

A nginx Docker container that is deployed on Kubernetes to serve local, static content over HTTPS using letsencrypt.org certificates.

This nginx webserver:

  1. Configures nginx according to settings outlined in ConfigMaps: * Configuration settings to be used in nginx are provided via a Kubernetes ConfigMap named nginx-config, defined as such as:

     apiVersion: v1
     kind: ConfigMap
     metadata:
       name: nginx-config
     data:
       nginx: |
         #!/bin/bash
    
         # settings
         export ENABLE_SSL="true"
         export SERVER_NAME="corekube.com"
    
         # directory paths
         ## letsencrypt
         export LETSENCRYPT_DIR="/srv/etc/letsencrypt"
         export SSL_CERTS_DIR="$LETSENCRYPT_DIR/live/$SERVER_NAME"
         export LETSENCRYPT_ACME_DIR="$LETSENCRYPT_DIR/webrootauth/.well-known/acme-challenge"
         ## nginx
         export ROOT_DIR="/srv/data/prod/dest"
    
* SSL/TLS certs to be used with nginx are provided via a Kubernetes Volume named `nginx-nfs-pvc`
  * The required certs are based off of the [letsencrypt.org](https://letsencrypt.org) cert directory structure in `/etc/letsencrypt/live/<DOMAIN>` and the Volume path mounted should expose the `/etc/letsencrypt` directory in its entirety. You can specify the location of the `/etc/letsencrypt` directory in your volume using `LETSENCRYPT_DIR` in `nginx-config`.
  1. Faciliates the ACME request that letsencrypt.org requires when attempting to validate the Domain and renew its certs, given that:
* The [letsencrypt.org](https://letsencrypt.org) directory, `/etc/letsencrypt`, is mounted via a Kubernetes Volume - in this case, we use the `LETSENCRYPT_DIR` in `nginx-config`.


* The nginx configuration has an alias for the location that the ACME request expects:

    ```
    server {
      ...
      location /.well-known/acme-challenge {
        alias {{LETSENCRYPT_ACME_DIR}};
      }
    }
    ```
  1. And lastly, serves the static HTML stored in the root directory, specified by ROOT_DIR in the nginx-config ConfigMap

nginx's People

Contributors

metral avatar

Watchers

James Cloos avatar  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.