Merge branch 'patch-2' into 'develop'
[akkoma] / installation / caddyfile-pleroma.example
1 # default Caddyfile config for Pleroma
2 #
3 # Simple installation instructions:
4 # 1. Replace 'example.tld' with your instance's domain wherever it appears.
5 # 2. Copy this section into your Caddyfile and restart Caddy.
6
7 example.tld {
8 log /var/log/caddy/pleroma_access.log
9 errors /var/log/caddy/pleroma_error.log
10
11 gzip
12
13 proxy / localhost:4000 {
14 websocket
15 transparent
16 }
17
18 tls {
19 # Remove the rest of the lines in here, if you want to support older devices
20 key_type p256
21 ciphers ECDHE-ECDSA-WITH-CHACHA20-POLY1305 ECDHE-RSA-WITH-CHACHA20-POLY1305 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256
22 }
23
24 header / {
25 X-XSS-Protection "1; mode=block"
26 X-Frame-Options "DENY"
27 X-Content-Type-Options "nosniff"
28 Referrer-Policy "same-origin"
29 Strict-Transport-Security "max-age=31536000; includeSubDomains;"
30 Expect-CT "enforce, max-age=2592000"
31 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://{host}; upgrade-insecure-requests;"
32 }
33
34 # If you do not want remote frontends to be able to access your Pleroma backend server, remove these lines.
35 # If you want to allow all origins access, remove the origin lines.
36 # To use this directive, you need the http.cors plugin for Caddy.
37 cors / {
38 origin https://halcyon.example.tld
39 origin https://pinafore.example.tld
40 methods POST,PUT,DELETE,GET,PATCH,OPTIONS
41 allowed_headers Authorization,Content-Type,Idempotency-Key
42 exposed_headers Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id
43 }
44 # Stop removing lines here.
45
46 # If you do not want to use the mediaproxy function, remove these lines.
47 # To use this directive, you need the http.cache plugin for Caddy.
48 cache {
49 match_path /proxy
50 default_max_age 720m
51 }
52 # Stop removing lines here.
53 }