Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matrix-media-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
matrix-media-repo
Commits
b6e044df
Commit
b6e044df
authored
7 years ago
by
Travis Ralston
Browse files
Options
Downloads
Patches
Plain Diff
Update configuration documentation
parent
1cf2773d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+75
-15
75 additions, 15 deletions
README.md
with
75 additions
and
15 deletions
README.md
+
75
−
15
View file @
b6e044df
...
@@ -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
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment