server { listen 80 default_server; server_name _; location /.well-known/matrix/server { default_type application/json; return 200 '{"m.server": "${APP_DOMAIN}:443"}'; } location /.well-known/matrix/client { default_type application/json; add_header Access-Control-Allow-Origin *; return 200 '{"m.homeserver": {"base_url": "https://${APP_DOMAIN}"}}'; } location / { return 404; } }