refactoring in between

This commit is contained in:
Nico Schottelius 2023-12-04 10:16:33 +01:00
commit a138276c54
10 changed files with 80 additions and 29 deletions

View file

@ -9,3 +9,10 @@ worker_listeners:
resources:
- names: [client, federation]
compress: false
- port: 9000
type: metrics
tls: false
x_forwarded: true
resources:
- names: [metrics]
compress: false

View file

@ -64,6 +64,7 @@ services:
volumes:
- ./nginx:/etc/nginx/conf.d
- /ssl:/ssl
- /mnt/logs/nginx:/var/log/nginx/
restart: unless-stopped
redis:
@ -71,18 +72,3 @@ services:
ports:
- "6379:6379/tcp"
restart: "unless-stopped"
# synapse-federation-sender-1:
# image: matrixdotorg/synapse:latest
# container_name: synapse-federation-sender-1
# restart: unless-stopped
# entrypoint: ["/start.py", "run", "--config-path=/data/homeserver.yaml", "--config-path=/data/workers/synapse-federation-sender-1.yaml"]
# healthcheck:
# disable: true
# network_mode: "host"
# volumes:
# - ./synapse:/data
# environment:
# SYNAPSE_WORKER: synapse.app.generic_worker
# depends_on:
# - synapse

View file

@ -8,6 +8,12 @@ server {
client_max_body_size 25m;
access_log /var/log/nginx/synapse-access-{{ inventory_hostname }}.log main;
access_log /var/log/nginx/access-{{ inventory_hostname }}.log main;
error_log /var/log/nginx/synapse-error-{{ inventory_hostname }}.log notice;
error_log /var/log/nginx/error-{{ inventory_hostname }}.log notice;
error_page 403 404 /403_404.html;
location = /403_404.html {
default_type application/json;
@ -59,6 +65,22 @@ server {
deny all;
}
# Metrics to master
location ~ /synapse-worker-generic/metrics {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://synapse-worker-generic:9000;
allow 10.161.228.115;
allow 10.161.228.116;
allow 10.161.228.117;
allow 10.161.228.118;
allow 10.161.228.119;
deny all;
}
# All other matrix/synapse requests go to main
location ~ /_matrix|/_synapse {
proxy_set_header X-Forwarded-For $remote_addr;