Skip to content

Instantly share code, notes, and snippets.

@niklasfi
Last active April 19, 2018 10:01
Show Gist options
  • Save niklasfi/4364eaecf7bd6bf1c2faf54102cdc642 to your computer and use it in GitHub Desktop.
Save niklasfi/4364eaecf7bd6bf1c2faf54102cdc642 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name matrix.niklasfi.de;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name matrix.niklasfi.de;
charset utf-8;
ssl_certificate /etc/letsencrypt/live/matrix.niklasfi.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/matrix.niklasfi.de/privkey.pem;
location /.well-known {
alias /var/www/letsencrypt/matrix.niklasfi.de/.well-known/;
}
location /_matrix {
proxy_pass http://localhost:5240/;
proxy_set_header X-Forwarded-For $remote_addr;
# add_header 'access-control-allow-origin' '*' always;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment