# 2023-04-02 server { listen 80 default_server; server_name matrix.domain.com; location /_matrix { proxy_pass http://192.168.50.102:8008; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 128m; } location /.well-known/matrix/server { access_log off; add_header Access-Control-Allow-Origin *; default_type application/json; return 200 '{"m.server": "matrix.domain.com:443"}'; } location /.well-known/matrix/client { access_log off; add_header Access-Control-Allow-Origin *; default_type application/json; return 200 '{"m.homeserver": {"base_url": "https://matrix.domain.com"}}'; } location / { return 301 /_matrix/static/; } }