This repository has been archived by the owner on Oct 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx-synapse.conf.template
66 lines (54 loc) · 2 KB
/
nginx-synapse.conf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${SYNAPSE_REVERSE_PROXY_SERVER_NAME};
ssl_certificate ${SYNAPSE_NGINX_FULLCHAIN};
ssl_certificate_key ${SYNAPSE_NGINX_PRIVKEY};
add_header Strict-Transport-Security \"max-age=15768000; includeSubdomains; preload\" always;
location / {
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_intercept_errors off;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection \$connection_upgrade;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header Host \$http_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-Proto \$scheme;
client_max_body_size ${SYNAPSE_MAX_UPLOAD_SIDE};
proxy_pass http://localhost:${SYNAPSE_HOST_PORT_HTTP};
}
location ~* ^(\/_matrix|\/_synapse\/client) {
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_intercept_errors off;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection \"Upgrade\";
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header Host \$http_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-Proto \$scheme;
client_max_body_size ${SYNAPSE_MAX_UPLOAD_SIDE};
proxy_pass http://localhost:${SYNAPSE_HOST_PORT_HTTP};
}
location /.well-known/matrix/client {
return 200 '{\"m.homeserver\": {\"base_url\": \"${SYNAPSE_PUBLIC_BASEURL}\"}}';
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
}
location /.well-known/matrix/server {
return 200 '{\"m.server\": \"${SYNAPSE_SERVER_NAME}\"}';
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
}
error_page 403 404 500 502 503 504 @error_page;
location @error_page {
root /usr/syno/share/nginx;
rewrite (.*) /error.html break;
allow all;
}
}