User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
howto:matrix-protocol [2026/03/19 07:54] vidakhowto:matrix-protocol [2026/03/19 07:59] (current) vidak
Line 39: Line 39:
 ``` ```
 root@matrix:~# cat /etc/matrix-synapse/homeserver.yaml  root@matrix:~# cat /etc/matrix-synapse/homeserver.yaml 
 +```
 +
 +```
 # 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://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html 
-# 
-# For more information on how to configure Synapse, including a complete accounting of 
-# each option, go to docs/usage/configuration/config_documentation.md or 
-# https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html 
 # #
 # This is set in /etc/matrix-synapse/conf.d/server_name.yaml for Debian installations. # This is set in /etc/matrix-synapse/conf.d/server_name.yaml for Debian installations.
 # server_name: "SERVERNAME" # server_name: "SERVERNAME"
 +
 pid_file: "/var/run/matrix-synapse.pid" pid_file: "/var/run/matrix-synapse.pid"
 listeners: listeners:
Line 124: Line 118:
 ``` ```
  
 +## Final NGINX configuration
 +
 +```
 +vidak@nginx:~$ cat /etc/nginx/sites-enabled/default 
 +```
 +
 +```
 +# Default server configuration
 +#
 +server {
 +
 +        root /var/www/html;
 +
 +        # 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 /etc/letsencrypt/live/solarpunk.au/fullchain.pem; # managed by Certbot
 +    ssl_certificate_key /etc/letsencrypt/live/solarpunk.au/privkey.pem; # managed by Certbot
 +    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 +    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 +
 +    listen 8448 ssl default_server;
 +    listen [::]:8448 ssl default_server;
 +
 +    location ~ ^(/_matrix|/_synapse/client) {
 +        # 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://matrix.pluto.sks.lan:8008;
 +        proxy_set_header X-Forwarded-For $remote_addr;
 +        proxy_set_header X-Forwarded-Proto $scheme;
 +        proxy_set_header Host $host:$server_port;
 +
 +        # 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 /.well-known/matrix/client {
 +    return 200 '{"m.homeserver": {"base_url": "https://solarpunk.au"}}';
 +    default_type application/json;
 +    add_header Access-Control-Allow-Origin *;
 +}
 +
 +location /.well-known/matrix/server {
 +        return 200 '{"m.server": "solarpunk.au:443"}';
 +        default_type application/json;
 +        add_header Access-Control-Allow-Origin *;
 +    }
 +
 +
 +}
 +
 +server {
 +    if ($host = solarpunk.au) {
 +        return 301 https://$host$request_uri;
 +    } # managed by Certbot
 +
 +
 +        listen 80 default_server;
 +        listen [::]:80 default_server;
 +
 +        server_name solarpunk.au;
 +    return 404; # managed by Certbot
 +
 +
 +}
 +```
  

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information