Giter VIP home page Giter VIP logo

docker-knginx's Introduction

docker-knginx

Nginx(OpenResty) to Reverse Proxy Kubernetes Services

See full example here https://github.com/mingfang/jenkins-seed/blob/master/services.yml

Knginx Service Definition

  - name: knginx
    ports:
      - {port: 80, name: http}
      - {port: 443, name: https}
    containers:
      - name: knginx
        image: rebelsoft.com/knginx:latest
        ports:
          - {containerPort: 80,    hostPort: 80}
          - {containerPort: 443,    hostPort: 443}

Features

Service Discovery

Sample Service Using HTTPBIN

  - name: httpbin
    ports:
      - port: 5000
    annotations:
      nginx:
        - http:
            - server: default
              paths:
                - path: /
    containers:
      - name: httpbin
        image: rebelsoft.com/httpbin:latest

Virtual Hosting

..
    annotations:
      nginx:
        - http:
            - server: default
              paths:
                - path: /
        - http:
            - server: httpbin.*
              paths:
                - path: /
..                

Canary Service

Split 10% traffic from v1 to v2

  - name: httpbin
    ports:
      - port: 5000
    annotations:
      nginx:
        - http:
            - server: default
              paths:
                - path: /
    containers:
      - name: httpbin
        image: rebelsoft.com/httpbin:v1
    canary:
      pct_traffic: 10
      containers:
        - name: httpbin
          image: rebelsoft.com/httpbin:v2

SAML SSO

Add to Knginx Definition

..
        env:
          - {name: SAML_IDP_URL, value: "http://<YOUR DOMAIN>/auth/realms/master/protocol/saml/clients/saml"}
..

Note: The SAML URL is provided by your IDP. Try https://github.com/mingfang/docker-keycloak.

Pagespeed

Add to Knginx Definition

..
        env:
          - {name: PAGESPEED, value: "on"}
..

Letsencrypt

Add to Knginx Definition

..
        env:
          - {name: LETSENCRYPT_DOMAINS, value: "www.rebelsoft.com|rebelsoft.com"}
..

docker-knginx's People

Contributors

mingfang avatar minglearnvest avatar

Watchers

 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.