Last active
May 14, 2021 16:53
-
-
Save joenas/194af2f7c2ccf2b04b0a8472974c2447 to your computer and use it in GitHub Desktop.
Nginx example conf for Synapse matrix Homeserver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: syntax=nginx | |
server { | |
listen 80; | |
server_name example.com www.example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name example.com; | |
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; | |
# If you don't wanna serve a site, comment this out | |
root /var/www/example.com; | |
index index.html index.htm; | |
# See https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md#nginx for latest examples | |
location ~* ^(\/_matrix|\/_synapse\/client) { | |
proxy_pass http://localhost:8008; | |
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 50M; | |
} | |
} |
Invalid from the looks of it, refer to https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md#nginx instead.
What bugs me is your location, it should belocation ~* ^(\/_matrix|\/_synapse\/client)
according to the docs (and my experience).
yes, is true that
Indeed Adrien, it looks like they updated that some time ago. Still working just fine for me though 🙂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Invalid from the looks of it, refer to https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md#nginx instead.
What bugs me is your location, it should be
location ~* ^(\/_matrix|\/_synapse\/client)
according to the docs (and my experience).