Sign inSign up

pfillion/reverse-proxy

By pfillion

•Updated 10 months ago

Image
0

1.8K

pfillion/reverse-proxy repository overview

⁠reverse-proxy

status-badge GitHub GitHub last commit

Docker Image Version (tag latest semver) Docker Image Size (latest by date)

A simple reverse-proxy under nginx for docker. It use the Let's Encrypt client and ACME library lego⁠ written in Go for creation of certificates. More, you can setup cron job to renew certificates for all your site behind your reverse-proxy.

⁠Versions

⁠Tools included in the docker image

  • lego
  • libressl
  • nginx-mod-stream

⁠Environnement variables

The reverse-proxy support one environnement variables.

LEGO_MODE definde how lego will interact with Let's Encrypt for ACME challenge. The value possible is staging (default) and normal. For testing, it recommender to use the staging api.

⁠Configuration file

You can mount directly a file or use docker configuration to schedule all job like a crontab file. See the example below.

  • /configs/config.json
[
    {
        "schedule": "0 0 0 */2 *",
        "command": "lego.sh",
        "args": [
            "www.example.com",
            "[email protected]"
        ]
    },
    {
        "schedule": "0 0 0 */2 *",
        "command": "lego.sh",
        "args": [
            "another.example.com",
            "[email protected]"
        ]
    },
    ...
]

This config will schedule cron job for renew certificate and copy them in the /.lego folder by default. All yopu have to do is configure you nginx proxy to use them.

  • /etc/nginx/nginx.conf
server {
    listen 443 ssl;
    http2 on; 
    server_name www.example.com;
    ssl_certificate /.lego/certificates/www.example.com.crt; 
    ssl_certificate_key  /.lego/certificates/www.example.com.key;
    ... 
}

⁠Docker compose

See the docker swarm in the source code or below.

version: '3.7'

services:
  nginx-proxy:
    image: pfillion/reverse-proxy:latest
    environment:
      LEGO_MODE: 'staging'
    networks:
      - reverse_proxy_network
    ports:
      - 80:80
      - 443:443
    volumes:
      - nginx_volume:/etc/nginx
      - cron_configs_volume:/configs

networks:
  reverse_proxy_network:
    driver: overlay

volumes:
  nginx_volume:
    ...
  cron_configs_volume:
    ...

⁠Authors

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:043cb777b…

Size

68.1 MB

Last updated

10 months ago

docker pull pfillion/reverse-proxy