Merge branch 'develop' into feature/compat/push-subscriptions
[akkoma] / installation / pleroma-apache.conf
1 # default Apache site config for Pleroma
2 #
3 # needed modules: define headers proxy proxy_http proxy_wstunnel rewrite ssl
4 #
5 # Simple installation instructions:
6 # 1. Install your TLS certificate, possibly using Let's Encrypt.
7 # 2. Replace 'example.tld' with your instance's domain wherever it appears.
8 # 3. This assumes a Debian style Apache config. Copy this file to
9 # /etc/apache2/sites-available/ and then add a symlink to it in
10 # /etc/apache2/sites-enabled/ by running 'a2ensite pleroma-apache.conf', then restart Apache.
11
12 Define servername example.tld
13
14 ServerName ${servername}
15 ServerTokens Prod
16
17 ErrorLog ${APACHE_LOG_DIR}/error.log
18 CustomLog ${APACHE_LOG_DIR}/access.log combined
19
20 <VirtualHost *:80>
21 Redirect permanent / https://${servername}
22 </VirtualHost>
23
24 <VirtualHost *:443>
25 SSLEngine on
26 SSLCertificateFile /etc/letsencrypt/live/${servername}/cert.pem
27 SSLCertificateKeyFile /etc/letsencrypt/live/${servername}/privkey.pem
28 SSLCertificateChainFile /etc/letsencrypt/live/${servername}/fullchain.pem
29
30 # Mozilla modern configuration, tweak to your needs
31 SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
32 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
33 SSLHonorCipherOrder on
34 SSLCompression off
35 SSLSessionTickets off
36
37 RewriteEngine On
38 RewriteCond %{HTTP:Connection} Upgrade [NC]
39 RewriteCond %{HTTP:Upgrade} websocket [NC]
40 RewriteRule /(.*) ws://localhost:4000/$1 [P,L]
41
42 ProxyRequests off
43 ProxyPass / http://localhost:4000/
44 ProxyPassReverse / http://localhost:4000/
45
46 RequestHeader set Host ${servername}
47 ProxyPreserveHost On
48 </VirtualHost>
49
50 # OCSP Stapling, only in httpd 2.3.3 and later
51 SSLUseStapling on
52 SSLStaplingResponderTimeout 5
53 SSLStaplingReturnResponderErrors off
54 SSLStaplingCache shmcb:/var/run/ocsp(128000)