logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

pleroma-apache.conf (3007B)


  1. # Sample Apache config for Pleroma
  2. #
  3. # Simple installation instructions:
  4. # 1. Install your TLS certificate. We recommend using Let's Encrypt via Certbot
  5. # 2. Replace 'example.tld' with your instance's domain.
  6. # 3. This assumes a Debian-style Apache config. Copy this file to
  7. # /etc/apache2/sites-available/ and then activate the site by running
  8. # 'a2ensite pleroma-apache.conf', then restart Apache.
  9. #
  10. # Optional: enable disk-based caching for the media proxy
  11. # For details, see https://git.pleroma.social/pleroma/pleroma/wikis/How%20to%20activate%20mediaproxy
  12. #
  13. # 1. Create a directory as shown below for the CacheRoot and make sure
  14. # the Apache user can write to it.
  15. # 2. Configure Apache's htcacheclean to clean the directory periodically.
  16. # Your OS may provide a service you can enable to do this automatically.
  17. Define servername example.tld
  18. <IfModule !proxy_module>
  19. LoadModule proxy_module libexec/apache24/mod_proxy.so
  20. </IfModule>
  21. <IfModule !proxy_http_module>
  22. LoadModule proxy_http_module libexec/apache24/mod_proxy_http.so
  23. </IfModule>
  24. <IfModule !proxy_wstunnel_module>
  25. LoadModule proxy_wstunnel_module libexec/apache24/mod_proxy_wstunnel.so
  26. </IfModule>
  27. <IfModule !rewrite_module>
  28. LoadModule rewrite_module libexec/apache24/mod_rewrite.so
  29. </IfModule>
  30. <IfModule !ssl_module>
  31. LoadModule ssl_module libexec/apache24/mod_ssl.so
  32. </IfModule>
  33. <IfModule !cache_module>
  34. LoadModule cache_module libexec/apache24/mod_cache.so
  35. </IfModule>
  36. <IfModule !cache_disk_module>
  37. LoadModule cache_disk_module libexec/apache24/mod_cache_disk.so
  38. </IfModule>
  39. ServerName ${servername}
  40. ServerTokens Prod
  41. # If you want Pleroma-specific logs
  42. #ErrorLog /var/log/httpd-pleroma-error.log
  43. #CustomLog /var/log/httpd-pleroma-access.log combined
  44. <VirtualHost *:80>
  45. RewriteEngine on
  46. RewriteCond %{SERVER_NAME} =${servername}
  47. RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  48. </VirtualHost>
  49. <VirtualHost *:443>
  50. SSLEngine on
  51. SSLCertificateFile /etc/letsencrypt/live/${servername}/fullchain.pem
  52. SSLCertificateKeyFile /etc/letsencrypt/live/${servername}/privkey.pem
  53. # Make sure you have the certbot-apache module installed
  54. Include /etc/letsencrypt/options-ssl-apache.conf
  55. # Uncomment the following to enable MediaProxy caching on disk
  56. #CacheRoot /tmp/pleroma-media-cache/
  57. #CacheDirLevels 1
  58. #CacheDirLength 2
  59. #CacheEnable disk /proxy
  60. #CacheLock on
  61. #CacheHeader on
  62. #CacheDetailHeader on
  63. ## 16MB max filesize for caching, configure as desired
  64. #CacheMaxFileSize 16000000
  65. #CacheDefaultExpire 86400
  66. RewriteEngine On
  67. RewriteCond %{HTTP:Connection} Upgrade [NC]
  68. RewriteCond %{HTTP:Upgrade} websocket [NC]
  69. RewriteRule /(.*) ws://127.0.0.1:4000/$1 [P,L]
  70. #ProxyRequests must be off or you open your server to abuse as an open proxy
  71. ProxyRequests off
  72. ProxyPass / http://127.0.0.1:4000/
  73. ProxyPassReverse / http://127.0.0.1:4000/
  74. ProxyPreserveHost On
  75. </VirtualHost>