Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
24d9151a
Unverified
Commit
24d9151a
authored
4 years ago
by
Richard van der Hoff
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Formatting for reverse-proxy docs (#7514)
also a small clarification to nginx
parent
572b444d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/7514.doc
+1
-0
1 addition, 0 deletions
changelog.d/7514.doc
docs/reverse_proxy.md
+78
-68
78 additions, 68 deletions
docs/reverse_proxy.md
with
79 additions
and
68 deletions
changelog.d/7514.doc
0 → 100644
+
1
−
0
View file @
24d9151a
Improve the formatting of `reverse_proxy.md`.
This diff is collapsed.
Click to expand it.
docs/reverse_proxy.md
+
78
−
68
View file @
24d9151a
...
@@ -34,97 +34,107 @@ the reverse proxy and the homeserver.
...
@@ -34,97 +34,107 @@ the reverse proxy and the homeserver.
### nginx
### nginx
server {
```
listen 443 ssl;
server {
listen [::]:443 ssl;
listen 443 ssl;
server_name matrix.example.com;
listen [::]:443 ssl;
server_name matrix.example.com;
location /_matrix {
proxy_pass http://localhost:8008;
location /_matrix {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008;
# Nginx by default only allows file uploads up to 1M in size
proxy_set_header X-Forwarded-For $remote_addr;
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
# Nginx by default only allows file uploads up to 1M in size
client_max_body_size 10M;
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
}
client_max_body_size 10M;
}
}
}
server {
listen 8448 ssl default_server;
server {
listen [::]:8448 ssl default_server;
listen 8448 ssl default_server;
server_name example.com;
listen [::]:8448 ssl default_server;
server_name example.com;
location / {
proxy_pass http://localhost:8008;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8008;
}
proxy_set_header X-Forwarded-For $remote_addr;
}
}
}
> **NOTE**: Do not add a `/` after the port in `proxy_pass`, otherwise nginx will
```
**NOTE**
: Do not add a path after the port in
`proxy_pass`
, otherwise nginx will
canonicalise/normalise the URI.
canonicalise/normalise the URI.
### Caddy 1
### Caddy 1
matrix.example.com {
```
proxy /_matrix http://localhost:8008 {
matrix.example.com {
transparent
proxy /_matrix http://localhost:8008 {
}
transparent
}
}
}
example.com:8448 {
example.com:8448 {
proxy / http://localhost:8008 {
proxy / http://localhost:8008 {
transparent
transparent
}
}
}
}
```
### Caddy 2
### Caddy 2
matrix.example.com {
```
reverse_proxy /_matrix/* http://localhost:8008
matrix.example.com {
}
reverse_proxy /_matrix/* http://localhost:8008
}
example.com:8448 {
example.com:8448 {
reverse_proxy http://localhost:8008
reverse_proxy http://localhost:8008
}
}
```
### Apache
### Apache
<VirtualHost *:443>
```
SSLEngine on
<VirtualHost *:443>
ServerName matrix.example.com;
SSLEngine on
ServerName matrix.example.com;
AllowEncodedSlashes NoDecode
AllowEncodedSlashes NoDecode
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
</VirtualHost>
</VirtualHost>
<VirtualHost *:8448>
<VirtualHost *:8448>
SSLEngine on
SSLEngine on
ServerName example.com;
ServerName example.com;
AllowEncodedSlashes NoDecode
AllowEncodedSlashes NoDecode
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPass /_matrix http://127.0.0.1:8008/_matrix nocanon
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
</VirtualHost>
</VirtualHost>
```
>
**NOTE**: ensure the `nocanon` options are included.
**NOTE**
: ensure the
`nocanon`
options are included.
### HAProxy
### HAProxy
frontend https
```
bind :::443 v4v6 ssl crt /etc/ssl/haproxy/ strict-sni alpn h2,http/1.1
frontend https
bind :::443 v4v6 ssl crt /etc/ssl/haproxy/ strict-sni alpn h2,http/1.1
# Matrix client traffic
# Matrix client traffic
acl matrix-host hdr(host) -i matrix.example.com
acl matrix-host hdr(host) -i matrix.example.com
acl matrix-path path_beg /_matrix
acl matrix-path path_beg /_matrix
use_backend matrix if matrix-host matrix-path
use_backend matrix if matrix-host matrix-path
frontend matrix-federation
frontend matrix-federation
bind :::8448 v4v6 ssl crt /etc/ssl/haproxy/synapse.pem alpn h2,http/1.1
bind :::8448 v4v6 ssl crt /etc/ssl/haproxy/synapse.pem alpn h2,http/1.1
default_backend matrix
default_backend matrix
backend matrix
backend matrix
server matrix 127.0.0.1:8008
server matrix 127.0.0.1:8008
```
## Homeserver Configuration
## Homeserver Configuration
...
...
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