server {
    listen 80;

    location /.well-known/matrix/server {
        default_type application/json;
        return 200 '{"m.server":"matrix.theocloud.dev:443"}';
    }

    location /.well-known/matrix/client {
        default_type application/json;
        add_header Access-Control-Allow-Origin *;
        return 200 '{"m.homeserver":{"base_url":"https://matrix.theocloud.dev"}}';
    }

    location / {
        proxy_pass http://192.168.12.151:8008;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
