Snippet content copied to clipboard.
Are you sure to delete this snippet? No, don't delete

Comparison with previous snippet

  1. --- Previous Snippet
  2. +++ Current Snippet
  3. @@ -4,3 +4,3 @@
  4. listen 443 ssl;
  5. - server_name matrix.frank-ruan.com;
  6. + server_name BACK_END_URL;
  1. server
  2. {
  3. listen 80;
  4. listen 443 ssl;
  5. server_name BACK_END_URL;
  6. #SSL-START SSL related configuration, do NOT delete or modify the next line of commented-out 404 rules
  7. #error_page 404/404.html;
  8. ssl_certificate /etc/nginx/cert/cert.crt;
  9. ssl_certificate_key /etc/nginx/cert/cert.key;
  10. ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  11. ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  12. ssl_prefer_server_ciphers on;
  13. ssl_session_cache shared:SSL:10m;
  14. ssl_session_timeout 10m;
  15. add_header Strict-Transport-Security "max-age=31536000";
  16. error_page 497 https://$host$request_uri;
  17. #SSL-END
  18. #ERROR-PAGE-START Error page configuration, allowed to be commented, deleted or modified
  19. #error_page 404 /404.html;
  20. #error_page 502 /502.html;
  21. #ERROR-PAGE-END
  22. # Forbidden files or directories
  23. location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
  24. {
  25. return 404;
  26. }
  27. location ~ ^(/_matrix|/_synapse/client) {
  28. # note: do not add a path (even a single /) after the port in `proxy_pass`,
  29. # otherwise nginx will canonicalise the URI and cause signature verification
  30. # errors.
  31. proxy_pass http://127.0.0.1:8001;
  32. proxy_set_header X-Forwarded-For $remote_addr;
  33. proxy_set_header X-Forwarded-Proto $scheme;
  34. proxy_set_header Host $host;
  35. # Nginx by default only allows file uploads up to 1M in size
  36. # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
  37. client_max_body_size 500M;
  38. }
  39. }

Edit this Snippet