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.

57 lines
2.6KB

  1. #Example configuration for when Apache httpd and Pleroma are on the same host.
  2. #Needed modules: headers proxy proxy_http proxy_wstunnel rewrite ssl
  3. #This assumes a Debian style Apache config. Put this in /etc/apache2/sites-available
  4. #Install your TLS certificate, possibly using Let's Encrypt.
  5. #Replace 'pleroma.example.com' with your instance's domain wherever it appears
  6. ServerName pleroma.example.com
  7. ServerTokens Prod
  8. ErrorLog ${APACHE_LOG_DIR}/error.log
  9. CustomLog ${APACHE_LOG_DIR}/access.log combined
  10. <VirtualHost *:80>
  11. Redirect permanent / https://pleroma.example.com
  12. </VirtualHost>
  13. <VirtualHost *:443>
  14. SSLEngine on
  15. SSLCertificateFile /etc/letsencrypt/live/pleroma.example.com/cert.pem
  16. SSLCertificateKeyFile /etc/letsencrypt/live/pleroma.example.com/privkey.pem
  17. SSLCertificateChainFile /etc/letsencrypt/live/pleroma.example.com/fullchain.pem
  18. # Mozilla modern configuration, tweak to your needs
  19. SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
  20. SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
  21. SSLHonorCipherOrder on
  22. SSLCompression off
  23. SSLSessionTickets off
  24. # OCSP Stapling, only in httpd 2.3.3 and later
  25. SSLUseStapling on
  26. SSLStaplingResponderTimeout 5
  27. SSLStaplingReturnResponderErrors off
  28. SSLStaplingCache shmcb:/var/run/ocsp(128000)
  29. Header always set X-Xss-Protection "1; mode=block"
  30. Header always set X-Frame-Options "DENY"
  31. Header always set X-Content-Type-Options "nosniff"
  32. Header always set Referrer-Policy same-origin
  33. Header always set Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://pleroma.example.tld; upgrade-insecure-requests;"
  34. # Uncomment this only after you get HTTPS working.
  35. # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
  36. RewriteEngine On
  37. RewriteCond %{HTTP:Connection} Upgrade [NC]
  38. RewriteCond %{HTTP:Upgrade} websocket [NC]
  39. RewriteRule /(.*) ws://localhost:4000/$1 [P,L]
  40. ProxyRequests off
  41. ProxyPass / http://localhost:4000/
  42. ProxyPassReverse / http://localhost:4000/
  43. RequestHeader set Host "pleroma.example.com"
  44. ProxyPreserveHost On
  45. </VirtualHost>