}
header / {
- X-XSS-Protection "1; mode=block"
- X-Frame-Options "DENY"
- X-Content-Type-Options "nosniff"
- Referrer-Policy "same-origin"
Strict-Transport-Security "max-age=31536000; includeSubDomains;"
Expect-CT "enforce, max-age=2592000"
- 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;"
}
- # If you do not want remote frontends to be able to access your Pleroma backend server, remove these lines.
- # If you want to allow all origins access, remove the origin lines.
- # To use this directive, you need the http.cors plugin for Caddy.
- cors / {
- origin https://halcyon.example.tld
- origin https://pinafore.example.tld
- methods POST,PUT,DELETE,GET,PATCH,OPTIONS
- allowed_headers Authorization,Content-Type,Idempotency-Key
- exposed_headers Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id
- }
- # Stop removing lines here.
-
# If you do not want to use the mediaproxy function, remove these lines.
# To use this directive, you need the http.cache plugin for Caddy.
cache {
SSLCompression off
SSLSessionTickets off
- Header always set X-Xss-Protection "1; mode=block"
- Header always set X-Frame-Options "DENY"
- Header always set X-Content-Type-Options "nosniff"
- Header always set Referrer-Policy same-origin
- Header always set 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://${servername}; upgrade-insecure-requests;"
-
# Uncomment this only after you get HTTPS working.
# Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
client_max_body_size 16m;
location / {
- add_header X-XSS-Protection "1; mode=block" always;
- add_header X-Permitted-Cross-Domain-Policies "none" always;
- add_header X-Frame-Options "DENY" always;
- add_header X-Content-Type-Options "nosniff" always;
- add_header Referrer-Policy "same-origin" always;
- add_header X-Download-Options "noopen" always;
- add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action *; 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://$server_name; upgrade-insecure-requests;" always;
-
# Uncomment this only after you get HTTPS working.
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}
sub vcl_deliver {
- set resp.http.X-Frame-Options = "DENY";
- set resp.http.X-XSS-Protection = "1; mode=block";
- set resp.http.X-Content-Type-Options = "nosniff";
- set resp.http.Referrer-Policy = "same-origin";
- set resp.http.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://" + req.http.host + "; upgrade-insecure-requests;";
# Uncomment this only after you get HTTPS working.
# set resp.http.Strict-Transport-Security= "max-age=31536000; includeSubDomains";
}