Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| howto:matrix-protocol [2026/03/19 07:54] – vidak | howto:matrix-protocol [2026/03/19 07:59] (current) – vidak | ||
|---|---|---|---|
| Line 39: | Line 39: | ||
| ``` | ``` | ||
| root@matrix: | root@matrix: | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| # Configuration file for Synapse. | # Configuration file for Synapse. | ||
| - | # | ||
| - | # This is a YAML file: see [1] for a quick introduction. Note in particular | ||
| - | # that *indentation is important*: all the elements of a list or dictionary | ||
| - | # should have the same indentation. | ||
| - | # | ||
| - | # [1] https:// | ||
| - | # | ||
| - | # For more information on how to configure Synapse, including a complete accounting of | ||
| - | # each option, go to docs/ | ||
| - | # https:// | ||
| # | # | ||
| # This is set in / | # This is set in / | ||
| # server_name: | # server_name: | ||
| + | |||
| pid_file: "/ | pid_file: "/ | ||
| listeners: | listeners: | ||
| Line 124: | Line 118: | ||
| ``` | ``` | ||
| + | ## Final NGINX configuration | ||
| + | |||
| + | ``` | ||
| + | vidak@nginx: | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | # Default server configuration | ||
| + | # | ||
| + | server { | ||
| + | |||
| + | root / | ||
| + | |||
| + | # Add index.php to the list if you are using PHP | ||
| + | index index.html index.htm index.nginx-debian.html; | ||
| + | |||
| + | server_name solarpunk.au; | ||
| + | |||
| + | listen [::]:443 ssl; # managed by Certbot | ||
| + | listen 443 ssl; # managed by Certbot | ||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | include / | ||
| + | ssl_dhparam / | ||
| + | |||
| + | listen 8448 ssl default_server; | ||
| + | listen [::]:8448 ssl default_server; | ||
| + | |||
| + | location ~ ^(/ | ||
| + | # note: do not add a path (even a single /) after the port in `proxy_pass`, | ||
| + | # otherwise nginx will canonicalise the URI and cause signature verification | ||
| + | # errors. | ||
| + | proxy_pass http:// | ||
| + | proxy_set_header X-Forwarded-For $remote_addr; | ||
| + | proxy_set_header X-Forwarded-Proto $scheme; | ||
| + | proxy_set_header Host $host: | ||
| + | |||
| + | # Nginx by default only allows file uploads up to 1M in size | ||
| + | # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml | ||
| + | client_max_body_size 100M; | ||
| + | | ||
| + | # Synapse responses may be chunked, which is an HTTP/1.1 feature. | ||
| + | proxy_http_version 1.1; | ||
| + | } | ||
| + | |||
| + | location / | ||
| + | return 200 ' | ||
| + | default_type application/ | ||
| + | add_header Access-Control-Allow-Origin *; | ||
| + | } | ||
| + | |||
| + | location / | ||
| + | return 200 ' | ||
| + | default_type application/ | ||
| + | add_header Access-Control-Allow-Origin *; | ||
| + | } | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | server { | ||
| + | if ($host = solarpunk.au) { | ||
| + | return 301 https:// | ||
| + | } # managed by Certbot | ||
| + | |||
| + | |||
| + | listen 80 default_server; | ||
| + | listen [::]:80 default_server; | ||
| + | |||
| + | server_name solarpunk.au; | ||
| + | return 404; # managed by Certbot | ||
| + | |||
| + | |||
| + | } | ||
| + | ``` | ||