ponysearch-docker/Caddyfile

84 lines
2.9 KiB
Text
Raw Permalink Normal View History

{$SEARX_PROTOCOL}{$SEARX_HOSTNAME} {
tls {$SEARX_TLS}
gzip {
not /morty
}
2019-07-01 16:26:12 +02:00
root /srv
header /config {
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Origin "*"
}
2019-07-01 16:26:12 +02:00
header /status {
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Origin "*"
}
header / {
# Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
2019-07-01 16:26:12 +02:00
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
2019-07-01 16:26:12 +02:00
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
2019-07-01 16:26:12 +02:00
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "SAMEORIGIN"
2019-07-01 16:26:12 +02:00
# CSP (see http://content-security-policy.com/ )
Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self'; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com"
2019-07-01 16:26:12 +02:00
# Disable some features
2019-08-06 12:44:08 +02:00
Feature-Policy "accelerometer 'none';ambient-light-sensor 'none'; autoplay 'none';camera 'none';encrypted-media 'none';focus-without-user-activation 'none'; geolocation 'none';gyroscope 'none';magnetometer 'none';microphone 'none';midi 'none';payment 'none';picture-in-picture 'none'; speaker 'none';sync-xhr 'none';usb 'none';vr 'none'"
2019-07-01 16:26:12 +02:00
# Cache
Cache-Control "no-cache, no-store"
Pragma "no-cache"
2019-07-01 16:26:12 +02:00
# Referer
Referrer-Policy "no-referrer"
2019-07-01 16:26:12 +02:00
# X-Robots-Tag
X-Robots-Tag "noindex, noarchive, nofollow"
# Remove Server header
-Server
2019-07-01 16:26:12 +02:00
}
2019-07-11 17:15:49 +02:00
header /morty {
Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'"
2019-07-11 17:15:49 +02:00
}
header /static {
Cache-Control "public, max-age=31536000"
-Pragma
}
2019-07-11 17:15:49 +02:00
rewrite / {
regexp ^/status$
to /searx-checker/status.json
}
proxy / localhost:4040 {
transparent
header_upstream X-Forwarded-TlsProto {tls_protocol}
header_upstream X-Forwarded-TlsCipher {tls_cipher}
header_upstream X-Forwarded-HttpsProto {proto}
except /searx-checker/status.json
2019-07-01 16:26:12 +02:00
}
basicauth /filtron {$FILTRON_USER} {$FILTRON_PASSWORD}
proxy /filtron/rules localhost:4041 {
without /filtron
}
proxy /morty localhost:3000
limits 10KB
2019-07-01 16:26:12 +02:00
}