forked from github.com/plausible-hosting
Add reverse-proxy configuration for existing Traefik installation
Largely based on the work of @MoryCorp in #10
This commit is contained in:
parent
f055f1d0aa
commit
ffccee3219
@ -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.
|
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
|
```shell
|
||||||
$ sudo cp reverse-proxy/nginx/plausible /etc/nginx/sites-available
|
$ sudo cp reverse-proxy/nginx/plausible /etc/nginx/sites-available
|
||||||
$ sudo ln -s /etc/nginx/sites-available/plausible /etc/nginx/sites-enabled/plausible
|
$ sudo ln -s /etc/nginx/sites-available/plausible /etc/nginx/sites-enabled/plausible
|
||||||
$ sudo certbot --nginx
|
$ 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
|
||||||
|
```
|
||||||
|
8
reverse-proxy/traefik/docker-compose.traefik.yml
Normal file
8
reverse-proxy/traefik/docker-compose.traefik.yml
Normal 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"
|
Loading…
Reference in New Issue
Block a user