synapse matrix
upstream synapse {
server 127.0.0.1:8008;
}
server {
listen 80;
server_name DOMAIN.LTD;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name DOMAIN.LTD;
access_log /var/log/nginx/DOMAIN.LTD_access.log;
error_log /var/log/nginx/DOMAIN.LTD_error.log warn;
ssl_certificate /etc/letsencrypt/live/DOMAIN.LTD/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN.LTD/privkey.pem;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://synapse;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 2048M;
proxy_http_version 1.1;
}
location ~ ^(/_matrix|/_synapse/client) {
proxy_pass http://synapse;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 2048M;
proxy_http_version 1.1;
}
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://DOMAIN.LTD"}}';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
}
Содержание