example configs: remove obsolete CSP configuration
[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 # Uncomment this only after you get HTTPS working.
38 # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
39
40 RewriteEngine On
41 RewriteCond %{HTTP:Connection} Upgrade [NC]
42 RewriteCond %{HTTP:Upgrade} websocket [NC]
43 RewriteRule /(.*) ws://localhost:4000/$1 [P,L]
44
45 ProxyRequests off
46 ProxyPass / http://localhost:4000/
47 ProxyPassReverse / http://localhost:4000/
48
49 RequestHeader set Host ${servername}
50 ProxyPreserveHost On
51 </VirtualHost>
52
53 # OCSP Stapling, only in httpd 2.3.3 and later
54 SSLUseStapling on
55 SSLStaplingResponderTimeout 5
56 SSLStaplingReturnResponderErrors off
57 SSLStaplingCache shmcb:/var/run/ocsp(128000)