Giter Club home page Giter Club logo

nginx-proxy's Introduction

Forked from https://github.com/jwilder/nginx-proxy

A new env varaible ENABLE_ACME is added to use acme.sh to generate free ssl cert from letsencrypt.

All the other options are the same as the upstream project: https://github.com/jwilder/nginx-proxy

It's very easy to use:

1. Run nginx reverse proxy

docker run  \
-p 80:80 \
-p 443:443 \
-it  -d --rm  \
-v /var/run/docker.sock:/tmp/docker.sock:ro  \
-v $(pwd)/proxy/certs:/etc/nginx/certs \
-v $(pwd)/proxy/acme:/acmecerts \
-v $(pwd)/proxy/conf.d:/etc/nginx/conf.d \
--name proxy \
neilpang/nginx-proxy

It's recommended to run with --net=host option, like:

docker run  \
-p 80:80 \
-p 443:443 \
-it  -d --rm  \
-v /var/run/docker.sock:/tmp/docker.sock:ro  \
-v $(pwd)/proxy/certs:/etc/nginx/certs \
-v $(pwd)/proxy/acme:/acmecerts \
-v $(pwd)/proxy/conf.d:/etc/nginx/conf.d \
--name proxy \
--net=host \
neilpang/nginx-proxy

For a docker compose v2 or v3 project, every project has a dedicated network, so, you must use --net=host option, so that it can proxy any projects on you machine.

Docker Compose

version: '2'

services:
  nginx-proxy:
    image: neilpang/nginx-proxy
    ports:
      - "80:80"
      volumes:
        - /var/run/docker.sock:/tmp/docker.sock:ro
        - ./proxy/certs:/etc/nginx/certs
        - ./proxy/acme:/acmecerts
        - ./proxy/conf.d:/etc/nginx/conf.d
      network_mode: "host"

2. Run an internal webserver

docker run -itd --rm \
-e VIRTUAL_HOST=foo.bar.com \
-e ENABLE_ACME=true \
httpd

The other options: https://github.com/Neilpang/nginx-proxy/blob/upstream/README.md

nginx-proxy's People

Contributors

27bslash6 avatar andrewvos avatar b1f6c1c4 avatar baptistedonaux avatar benhall avatar berfarah avatar bprodoehl avatar brikou avatar buchdag avatar gabriel403 avatar huiwang avatar josephpage avatar jwilder avatar kamermans avatar kevindoveton avatar mariusgundersen avatar matt-hh avatar mayeaux avatar md5 avatar qiqizjl avatar rarous avatar ryneeverett avatar schmunk42 avatar taxilian avatar teohhanhui avatar thajeztah avatar thomasleveil avatar vegasbrianc avatar viranch avatar webner avatar

Watchers

 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.