Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.2KB

  1. # default nginx site config for Pleroma
  2. #
  3. # Simple installation instructions:
  4. # 1. Install your TLS certificate, possibly using Let's Encrypt.
  5. # 2. Replace 'example.tld' with your instance's domain wherever it appears.
  6. # 3. Copy this file to /etc/nginx/sites-available/ and then add a symlink to it
  7. # in /etc/nginx/sites-enabled/ and restart nginx.
  8. proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
  9. inactive=720m use_temp_path=off;
  10. server {
  11. listen 80;
  12. server_name example.tld;
  13. return 301 https://$server_name$request_uri;
  14. }
  15. server {
  16. listen 443 ssl http2;
  17. ssl on;
  18. ssl_session_timeout 5m;
  19. ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
  20. ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
  21. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  22. ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
  23. ssl_prefer_server_ciphers on;
  24. server_name example.tld;
  25. gzip_vary on;
  26. gzip_proxied any;
  27. gzip_comp_level 6;
  28. gzip_buffers 16 8k;
  29. gzip_http_version 1.1;
  30. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml;
  31. # the nginx default is 1m, not enough for large media uploads
  32. client_max_body_size 16m;
  33. location / {
  34. # if you do not want remote frontends to be able to access your Pleroma backend
  35. # server, remove these lines.
  36. add_header 'Access-Control-Allow-Origin' '*' always;
  37. add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS' always;
  38. add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
  39. if ($request_method = OPTIONS) {
  40. return 204;
  41. }
  42. # stop removing lines here.
  43. proxy_http_version 1.1;
  44. proxy_set_header Upgrade $http_upgrade;
  45. proxy_set_header Connection "upgrade";
  46. proxy_set_header Host $http_host;
  47. proxy_pass http://localhost:4000;
  48. client_max_body_size 16m;
  49. }
  50. location /proxy {
  51. proxy_cache pleroma_media_cache;
  52. proxy_cache_lock on;
  53. proxy_pass http://localhost:4000;
  54. }
  55. }