server { listen 80; server_name matrix.teier.eu; return 301 https://$server_name:443$request_uri; } server { listen 443 ssl http2; # Federation Port listen 8448 ssl http2; ssl on; ssl_certificate /etc/letsencrypt/live/teier.eu/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/teier.eu/privkey.pem; server_name matrix.teier.eu; location ~* ^(\/_matrix|\/_synapse\/client) { proxy_pass http://127.0.0.1:8008; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 50M; } location / { proxy_pass http://127.0.0.1:8083; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 50M; } location /.well-known/matrix/ { alias /var/www/html/well-known/matrix/; } }