Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Neilpang/letsproxy
nginx reverse auto proxy with free ssl certs by acme.sh
https://github.com/Neilpang/letsproxy
Last synced: 5 days ago
JSON representation
nginx reverse auto proxy with free ssl certs by acme.sh
- Host: GitHub
- URL: https://github.com/Neilpang/letsproxy
- Owner: Neilpang
- Created: 2019-06-27T14:04:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T03:53:13.000Z (almost 2 years ago)
- Last Synced: 2024-10-14T19:43:01.535Z (25 days ago)
- Language: Dockerfile
- Homepage:
- Size: 46.9 KB
- Stars: 141
- Watchers: 6
- Forks: 43
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - Neilpang/letsproxy - nginx reverse auto proxy with free ssl certs by acme.sh (others)
README
Based on https://github.com/nginx-proxy/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.
It's very easy to use:### 1. Run nginx reverse proxy
```sh
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 \
-v $(pwd)/vhost.d:/etc/nginx/vhost.d \
-v $(pwd)/stream.d:/etc/nginx/stream.d \
-v $(pwd)/dhparam:/etc/nginx/dhparam \
--name proxy \
neilpang/letsproxy
```It's recommended to run with `--net=host` option, like:
```sh
docker run \
-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 \
-v $(pwd)/vhost.d:/etc/nginx/vhost.d \
-v $(pwd)/stream.d:/etc/nginx/stream.d \
-v $(pwd)/dhparam:/etc/nginx/dhparam \
--name proxy \
--net=host \
neilpang/letsproxy
```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
```yaml
version: '2'services:
letsproxy:
image: neilpang/letsproxy
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./proxy/certs:/etc/nginx/certs
- ./proxy/acme:/acmecerts
- ./proxy/conf.d:/etc/nginx/conf.d
- ./proxy/vhost.d:/etc/nginx/vhost.d
- ./proxy/stream.d:/etc/nginx/stream.d
- ./proxy/dhparam:/etc/nginx/dhparam
network_mode: "host"
```### 2. Run an internal webserver
```sh
docker run -itd --rm \
-e VIRTUAL_HOST=foo.bar.com \
-e ENABLE_ACME=true \
httpd```