Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- email [email protected]
- log default {
- output file /var/log/caddy/system.log
- format json {
- time_format iso8601
- duration_format string
- }
- }
- }
- (reverseproxyheaders) {
- header_up X-Real-IP {remote}
- }
- (securityheaders) {
- header Strict-Transport-Security max-age=31536000
- header X-Content-Type-Options nosniff
- header Referrer-Policy strict-origin-when-cross-origin
- }
- (accesslogs) {
- @internal client_ip <my-ip>/32 private_ranges
- log {args[0]} {
- output file /var/log/caddy/access-{args[0]}.log
- format json {
- time_format iso8601
- duration_format string
- }
- }
- log_skip @internal
- }
- (match_poland) {
- maxmind_geolocation {
- db_path "/etc/caddy/GeoLite2-Country.mmdb"
- allow_countries PL
- }
- }
- (ratelimitter) {
- rate_limit {
- zone dynamic {
- key {client_ip}
- events 100
- window 10s
- }
- log_key
- }
- }
- domain-a.com {
- import accesslogs root
- import securityheaders
- import ratelimitter
- respond "Hello, privacy!"
- }
- sub-a.domain-a.com {
- @poland {
- import match_poland
- }
- import accesslogs szuflandia
- import securityheaders
- import ratelimitter
- reverse_proxy @poland sub-a.local {
- import reverseproxyheaders
- }
- }
- sub-b.domain-a.com {
- @poland {
- import match_poland
- }
- import accesslogs chaos
- import securityheaders
- import ratelimitter
- reverse_proxy @poland sub-b.local {
- import reverseproxyheaders
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement