Add reverse-proxy configuration for existing Traefik installation

Largely based on the work of @MoryCorp in #10
This commit is contained in:
birjolaxew 2020-10-30 05:59:21 +01:00
parent f055f1d0aa
commit ffccee3219
No known key found for this signature in database
GPG Key ID: 548A6D4C439CC3DD
2 changed files with 19 additions and 1 deletions

View File

@ -16,10 +16,20 @@ If you are already running a reverse proxy, then the above will not work as it w
If you already have NGINX running as a system service, use the configuration file in the `nginx` directory.
Edit the file `reverse-proxy/nginx/plausible` to contain the domain name you use for your server, then copy it into NGINX's configuration folder. Enable it by creating a symlink in NGINX's enabled sites folder. Finally use Certbot to create a TLS certificate for your site.
Edit the file `reverse-proxy/nginx/plausible` to contain the domain name you use for your server, then copy it into NGINX's configuration folder. Enable it by creating a symlink in NGINX's enabled sites folder. Finally use Certbot to create a TLS certificate for your site:
```shell
$ sudo cp reverse-proxy/nginx/plausible /etc/nginx/sites-available
$ sudo ln -s /etc/nginx/sites-available/plausible /etc/nginx/sites-enabled/plausible
$ sudo certbot --nginx
```
### Traefik 2
If you already have a Traefik container running on Docker, use the docker-compose file in the `traefik` directory. Note that it assumes that your Traefik container is set up to support certificate generation.
Edit the file `reverse-proxy/traefik/docker-compose.traefik.yml` to contain the domain name you use for your server, then combine it with the existing docker-compose files:
```shell
$ docker-compose -f docker-compose.yml -f reverse-proxy/traefik/docker-compose.traefik.yml up
```

View File

@ -0,0 +1,8 @@
version: "3.3"
services:
plausible:
labels:
traefik.enable: "true"
traefik.http.routers.plausible.rule: "Host(`example.com`)" # change to your domain name
traefik.http.routers.plausible.entrypoints: "websecure"
traefik.http.services.plausible.loadbalancer.server.port: "8000"