implemented cross-domain matomo tracking on nginx level

This commit is contained in:
2023-11-18 20:02:55 +01:00
parent f285f2b46e
commit a60ec9fa21
54 changed files with 182 additions and 64 deletions

View File

@@ -0,0 +1,19 @@
# role nginx-docker-reverse-proxy
Uses nginx as an [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy) for local docker applications.
## debug
```bash
curl -I {{address}}
```
- https://serverfault.com/questions/434915/nginx-proxy-caching-how-to-check-if-it-is-working
## performance
- https://stackoverflow.com/questions/33703230/caching-images-on-all-folder-levels-of-nginx-reverse-proxy
- https://www.tweaked.io/guide/nginx-proxying/
- https://serverfault.com/questions/796735/nginx-reverse-proxy-is-slow/796740
- https://serverfault.com/questions/741610/what-is-the-difference-between-proxy-request-buffering-and-proxy-buffering-on-ng
- https://askubuntu.com/questions/1103626/should-i-enable-client-max-body-size-proxy-request-buffering-and-proxy-bufferin
- https://serverfault.com/questions/692577/whats-the-difference-between-proxy-buffer-and-proxy-cache-module-in-nginx-confi
- https://github.com/sissbruecker/linkding/issues/88
- https://www.bogotobogo.com/DevOps/Docker/docker-compose-Nginx-Reverse-Proxy-Multiple-Containers.php

View File

@@ -0,0 +1,3 @@
dependencies:
- docker
- nginx-https

View File

@@ -0,0 +1,18 @@
server
{
server_name {{domain}};
{% if nginx_matomo_tracking_active | default(False) %}
{% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %}
{% endif %}
{% if client_max_body_size is defined %}
client_max_body_size {{ client_max_body_size }};
{% endif %}
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
{% include 'proxy_pass.conf.j2' %}
}

View File

@@ -0,0 +1,25 @@
location /
{
proxy_pass http://127.0.0.1:{{http_port}}/;
# headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
# WebSocket specific header
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# deactivate buffering
proxy_buffering off;
proxy_request_buffering off;
# timeouts
proxy_connect_timeout 1s;
proxy_send_timeout 900s;
proxy_read_timeout 900s;
send_timeout 900s;
}