55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
# matrix.thevish.io - Legacy Matrix server (no federation, historical data)
|
|
server {
|
|
listen 8081;
|
|
listen [::]:8081;
|
|
server_name matrix.thevish.io;
|
|
|
|
# Element Web client
|
|
root /opt/element/web-thevish;
|
|
index index.html;
|
|
|
|
# Health check
|
|
location /health {
|
|
proxy_pass http://127.0.0.1:8008;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
# Client-Server API
|
|
location ~ ^(/_matrix|/_synapse/client) {
|
|
proxy_pass http://127.0.0.1:8008;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_set_header Host $host;
|
|
client_max_body_size 100M;
|
|
proxy_http_version 1.1;
|
|
}
|
|
|
|
# Federation API (won't work due to server_name being "vish")
|
|
location /_matrix/federation {
|
|
proxy_pass http://127.0.0.1:8008;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_set_header Host $host;
|
|
client_max_body_size 100M;
|
|
}
|
|
|
|
# Well-known (for reference, federation won't work)
|
|
location /.well-known/matrix/server {
|
|
default_type application/json;
|
|
return 200 '{"m.server": "matrix.thevish.io:443"}';
|
|
}
|
|
|
|
location /.well-known/matrix/client {
|
|
default_type application/json;
|
|
add_header Access-Control-Allow-Origin *;
|
|
return 200 '{"m.homeserver": {"base_url": "https://matrix.thevish.io"}}';
|
|
}
|
|
|
|
# Element static files
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|