Commit 23e3fbd4 authored by Pepijn Boers's avatar Pepijn Boers
Browse files

Minor update

parent 16cadbdb
## Matomo behind reverse proxy.
Let's create a reverse proxy with nginx, were listening to port 80 and 443 and pass request to matomo installations on different (local) ports.
We want to run two matomo servers, one who does respect DNT and one who doesn't. Since we want to compare there measures, they need to have their own database. Nginx configurations are stored in `nginx/nginx.conf`. Make sure to update the `server_name` and names of `ssl` certificate/key.
### Matomo (no DNT)
name-matomo: app (:5001)
name-db: db (:5002)
### Matomo (DNT)
name-matomo: app-dnt (:5011)
name-db: db-dnt (:5012)
All containers are started using docker-compose, see the `docker-compose.yml`.
## update config/config.ini.php
Because the secure connection is handled by nginx we can assume that the protocol is secure and send to matomo over http. Add these rules to `config/config.ini.php`:
```
[General]
assume_secure_protocol = 1
[General]
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST
```
## Start/stop everything using docker-compose
Use docker-compose to automatically restart failed containers:
```
docker-compose up -d
```
To stop everything type:
```
docker-compose stop
```
- to implement: [ngx_http_mirror_module](https://nginx.org/en/docs/http/ngx_http_mirror_module.html)
- [docker-compose 12 min tutorial](https://www.youtube.com/watch?v=Qw9zlE3t8Ko)
- [tutorial repo](https://github.com/jakewright/tutorials/tree/master/docker/02-docker-compose)
- [nginx and docker reverse proxy](https://www.youtube.com/watch?v=hxngRDmHTM0)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment