diff --git a/conf/nginx.conf b/conf/nginx.conf index db836aa..67627c3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,5 @@ location / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:__PORT__; proxy_redirect off; proxy_set_header Host $host; @@ -21,9 +16,26 @@ location / { include conf.d/yunohost_panel.conf.inc; } +location /.well-known/matrix/server { + return 200 '{ "m.server": "__DOMAIN__:443" }'; +} + +location /.well-known/matrix/client { + return 200 '{ "m.homeserver": { "base_url": "https://__DOMAIN__" } }'; +} + location /_matrix { - proxy_pass http://localhost:8008; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; -} \ No newline at end of file + proxy_pass http://localhost:8008; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_read_timeout 600; + client_max_body_size 100M; +} + +location /_synapse/admin { + proxy_pass http://localhost:8008; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_read_timeout 600; + client_max_body_size 100M; +}