Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

96 行
3.7 KiB

  1. server {
  2. listen 443 ssl http2;
  3. listen [::]:443 ssl http2;
  4. # TODO: add/remove services and their subdomains if you use/don't use them
  5. # this example is using hosting something on the base domain and an element web client, so example.com and element.example.com are listed in addition to matrix.example.com
  6. # if you don't use those, you can remove them
  7. # if you use e.g. dimension on dimension.example.com, add dimension.example.com to the server_name list
  8. server_name example.com matrix.example.com element.example.com;
  9. location / {
  10. # note: do not add a path (even a single /) after the port in `proxy_pass`,
  11. # otherwise, nginx will canonicalise the URI and cause signature verification
  12. # errors.
  13. proxy_pass http://localhost:81;
  14. proxy_set_header X-Forwarded-For $remote_addr;
  15. proxy_set_header X-Forwarded-Proto $scheme;
  16. proxy_set_header Host $host;
  17. proxy_set_header X-Real-IP $remote_addr;
  18. access_log /var/log/nginx/matrix.access.log;
  19. error_log /var/log/nginx/matrix.error.log;
  20. # Nginx by default only allows file uploads up to 1M in size
  21. # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
  22. client_max_body_size 50M;
  23. }
  24. # TODO: adapt the path to your ssl certificate for the domains listed on server_name
  25. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
  26. # TODO: adapt the path to your ssl certificate for the domains listed on server_name
  27. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
  28. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  29. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  30. }
  31. # settings for matrix federation
  32. server {
  33. # For the federation port
  34. listen 8448 ssl http2 default_server;
  35. listen [::]:8448 ssl http2 default_server;
  36. server_name matrix.example.com;
  37. location / {
  38. proxy_pass http://localhost:8449;
  39. proxy_set_header X-Forwarded-For $remote_addr;
  40. proxy_set_header X-Forwarded-Proto $scheme;
  41. proxy_set_header Host $host;
  42. access_log /var/log/nginx/matrix.access.log;
  43. error_log /var/log/nginx/matrix.error.log;
  44. # Nginx by default only allows file uploads up to 1M in size
  45. # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
  46. client_max_body_size 50M;
  47. }
  48. # TODO: adapt the path to your ssl certificate for the domains listed on server_name
  49. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
  50. # TODO: adapt the path to your ssl certificate for the domains listed on server_name
  51. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
  52. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  53. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  54. }
  55. # ensure using https
  56. # TODO: remove server blocks that you don't use / add server blocks for domains you do use
  57. server {
  58. if ($host = example.com) {
  59. return 301 https://$host$request_uri;
  60. } # managed by Certbot
  61. server_name example.com;
  62. listen 80;
  63. return 404; # managed by Certbot
  64. }
  65. server {
  66. if ($host = matrix.example.com) {
  67. return 301 https://$host$request_uri;
  68. } # managed by Certbot
  69. server_name matrix.example.com;
  70. listen 80;
  71. return 404; # managed by Certbot
  72. }
  73. server {
  74. if ($host = element.example.com) {
  75. return 301 https://$host$request_uri;
  76. } # managed by Certbot
  77. server_name element.example.com;
  78. listen 80;
  79. return 404; # managed by Certbot
  80. }