Skip to content
Snippets Groups Projects
Commit b6e044df authored by Travis Ralston's avatar Travis Ralston
Browse files

Update configuration documentation

parent 1cf2773d
Branches
No related tags found
No related merge requests found
...@@ -29,21 +29,81 @@ bin/matrix-media-repo ...@@ -29,21 +29,81 @@ bin/matrix-media-repo
This is intended to run behind a load balancer and beside your homeserver deployments. A sample nginx configuration for this is: This is intended to run behind a load balancer and beside your homeserver deployments. A sample nginx configuration for this is:
```ini ```ini
# Redirect all matrix traffic by default to the homeserver # Client-server API
location /_matrix { server {
proxy_read_timeout 60s; listen 80;
proxy_set_header Host $host; listen [::]:80;
proxy_set_header X-Real-IP $remote_addr; # ssl configuration not shown
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008; # Point this towards your homeserver # Redirect all matrix traffic by default to the homeserver
location /_matrix {
proxy_read_timeout 60s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008; # Point this towards your homeserver
}
# Redirect all media endpoints to the media-repo
location /_matrix/media {
proxy_read_timeout 60s;
proxy_set_header Host $host; # Make sure this matches your homeserver in media-repo.yaml
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8000; # Point this towards media-repo
}
} }
# Redirect all media endpoints to the media-repo # Federation
location /_matrix/media { # This also needs to be reverse proxied to capture the remote media fetching from other servers
proxy_read_timeout 60s; server {
proxy_set_header Host $host; # Make sure this matches your homeserver in media-repo.yaml listen 8448 ssl;
proxy_set_header X-Real-IP $remote_addr; listen [::]:8448 ssl;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8000; # Point this towards media-repo # These MUST match the certificates used by synapse!
ssl_certificate /home/matrix/.synapse/your.homeserver.com.tls.cert;
ssl_certificate_key /home/matrix/.synapse/your.homeserver.com.tls.key;
ssl_dhparam /home/matrix/.synapse/your.homeserver.com.tls.dh;
# Redirect all traffic by default to the homeserver
location / {
proxy_read_timeout 60s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008; # Point this towards your homeserver
}
# Redirect all media endpoints to the media-repo
location /_matrix/media {
proxy_read_timeout 60s;
proxy_set_header Host $host; # Make sure this matches your homeserver in media-repo.yaml
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8000; # Point this towards media-repo
}
} }
``` ```
\ No newline at end of file
Your synapse listener configuration would look something like this:
```yaml
listeners:
- port: 8558
bind_addresses: ['127.0.0.1']
type: http
tls: true
x_forwarded: true
resoruces:
- names: [federation]
compress: false
- port: 8008
bind_addresses: ['127.0.0.1']
type: http
tls: false
x_forwarded: true
resources:
- names: [client]
compress: true
- names: [federation]
compress: false
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment