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