Advertisement
Guest User

Untitled

a guest
Apr 24th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. {
  2. log default {
  3. output file /var/log/caddy/system.log
  4. format json {
  5. time_format iso8601
  6. duration_format string
  7. }
  8. }
  9. }
  10.  
  11. (reverseproxyheaders) {
  12. header_up X-Real-IP {remote}
  13. }
  14.  
  15. (securityheaders) {
  16. header Strict-Transport-Security max-age=31536000
  17. header X-Content-Type-Options nosniff
  18. header Referrer-Policy strict-origin-when-cross-origin
  19. }
  20.  
  21. (accesslogs) {
  22. @internal client_ip <my-ip>/32 private_ranges
  23. log {args[0]} {
  24. output file /var/log/caddy/access-{args[0]}.log
  25. format json {
  26. time_format iso8601
  27. duration_format string
  28. }
  29. }
  30. log_skip @internal
  31. }
  32.  
  33. (match_poland) {
  34. maxmind_geolocation {
  35. db_path "/etc/caddy/GeoLite2-Country.mmdb"
  36. allow_countries PL
  37. }
  38. }
  39.  
  40. (ratelimitter) {
  41. rate_limit {
  42. zone dynamic {
  43. key {client_ip}
  44. events 100
  45. window 10s
  46. }
  47. log_key
  48. }
  49. }
  50.  
  51. domain-a.com {
  52. import accesslogs root
  53. import securityheaders
  54. import ratelimitter
  55. respond "Hello, privacy!"
  56. }
  57.  
  58. sub-a.domain-a.com {
  59. @poland {
  60. import match_poland
  61. }
  62. import accesslogs szuflandia
  63. import securityheaders
  64. import ratelimitter
  65.  
  66. reverse_proxy @poland sub-a.local {
  67. import reverseproxyheaders
  68. }
  69. }
  70.  
  71. sub-b.domain-a.com {
  72. @poland {
  73. import match_poland
  74. }
  75. import accesslogs chaos
  76. import securityheaders
  77. import ratelimitter
  78.  
  79. reverse_proxy @poland sub-b.local {
  80. import reverseproxyheaders
  81. }
  82. }
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement