Advertisement
StarfighterZorg

Caddyfile (v0.10.x) - Common.conf Example

May 2nd, 2017
1,792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. ############################## Common.conf example for Caddy Server v0.10.x ###################################
  2.  
  3. # Notes: (Last edit: 1/08/18)
  4.  
  5. # You import this file into caddy server v0.10.x allowing you to share directives between server blocks
  6. # Should allow you to have a cleaner caddyfile since you're not repeating common directives for each server
  7. # "caddyfile" config example v0.10.x: https://pastebin.com/bLVJ4vsN
  8.  
  9. # Removed php startup directive since it'll startup a new instance each time the conf is imported (Moved directive to caddyfile)
  10.  
  11. # Removed HSTS "includeSubDomains; preload" and "-Server" from header block
  12. # They are/were carry over from an old Nginx setup I had and isn't useful to someone just using caddy as a reverse proxy!
  13.  
  14. # Old caddyfile v0.9.x (Deprecated but has more notes and setup information if needed without using a common.conf file!)
  15. # https://pastebin.com/sFUdPFvM
  16.  
  17. # Added needed rewrite code for OMbi V3
  18.  
  19. # Change all path "syntax" & "locations" to match your OS! e.g. "c:\caddy\www" for Windows or "/var/www" for nix file systems
  20.  
  21. ########################################### Code starts below #################################################
  22.  
  23.  
  24. ext .html .htm .php
  25. root /caddy/www # Change path syntax for your OS or your preferred location!
  26.  
  27. gzip
  28.  
  29. header / {
  30. X-Content-Type-Options nosniff
  31. X-XSS-Protection "1; mode=block"
  32. Strict-Transport-Security "max-age=31536000;"
  33. }
  34.  
  35. # New log directive syntax for v0.10.x
  36.  
  37. log /caddy/logs/access.log { # Change path syntax for your OS or your preferred location!
  38. rotate_size 1 # Rotate after 1 MB
  39. rotate_age 7 # Keep log files for 7 days
  40. rotate_keep 2 # Keep at most 2 log files
  41. }
  42.  
  43. errors /caddy/logs/error.log { # Change path syntax for your OS or your preferred location!
  44. rotate_size 1 # Set max size 1 MB
  45. rotate_age 7 # Keep log files for 7 days
  46. rotate_keep 2 # Keep at most 2 log files
  47. }
  48.  
  49. # You can normally use "127.0.0.1", use "Host IP" address if your running the web server or the apps on different machines
  50.  
  51. proxy /sabnzb 127.0.0.1:8080 { # https://sabnzbd.org/
  52. transparent
  53. }
  54.  
  55. proxy /htpc 127.0.0.1:8085 { # http://htpc.io/
  56. transparent
  57. }
  58.  
  59. proxy /headphones 127.0.0.1:8181 { # https://github.com/rembo10/headphones
  60. transparent
  61. }
  62.  
  63. proxy /mylar 127.0.0.1:8090 { # https://github.com/evilhero/mylar
  64. transparent
  65. }
  66.  
  67. proxy /lazy 127.0.0.1:5299 { # https://github.com/DobyTang/LazyLibrarian
  68. transparent
  69. }
  70.  
  71. proxy /emby 127.0.0.1:8096 { # https://emby.media/
  72. transparent
  73. }
  74.  
  75. proxy /sonarr 127.0.0.1:8989 { # https://sonarr.tv/
  76. transparent
  77. }
  78.  
  79. # Headphones uses port 8181 so make sure there's no conflict!
  80.  
  81. proxy /plexpy 127.0.0.1:8181 { # https://github.com/JonnyWong16/plexpy
  82. header_upstream X-Forwarded-Host {host}
  83. transparent
  84. }
  85.  
  86. proxy /nzbget 127.0.0.1:6789 { # http://nzbget.net/
  87. transparent
  88. }
  89.  
  90. proxy /couch 127.0.0.1:5050 { # https://couchpota.to/
  91. transparent
  92. }
  93.  
  94. proxy /nzbhydra 127.0.0.1:5075 { # https://github.com/theotherp/nzbhydra
  95. transparent
  96. }
  97.  
  98. # New rewrite rule needed to load some of Ombi V3's assets
  99.  
  100. rewrite {
  101. r ^/dist
  102. to /ombi/{uri}
  103. }
  104.  
  105. proxy /ombi 127.0.0.1:3579 { # https://github.com/tidusjar/Ombi
  106. transparent
  107. }
  108.  
  109. # The rewrite makes sure all of glances sub directory calls are proxied from domain to host
  110.  
  111. rewrite {
  112. if {>Referer} has /glances
  113. to /glances/{path}
  114. }
  115.  
  116. # The code below gives you a tiny level of security requiring a username/password before Caddy will let you connect to it
  117.  
  118. basicauth /glances Username Password
  119.  
  120. proxy /glances 127.0.0.1:61208 { # https://github.com/nicolargo/glances
  121. without /glances
  122. transparent
  123. }
  124.  
  125. proxy /deluge 127.0.0.1:8112 { # http://deluge-torrent.org/
  126. without /deluge
  127. transparent
  128. header_upstream X-Deluge-Base "/deluge"
  129. }
  130.  
  131. proxy /watcher 127.0.0.1:9090 { # https://github.com/nosmokingbandit/Watcher3
  132. transparent
  133. }
  134.  
  135. proxy /radarr 127.0.0.1:7878 { # https://github.com/Radarr/Radarr
  136. transparent
  137. }
  138.  
  139. # The code below will proxy PHP requests
  140.  
  141. fastcgi / 127.0.0.1:9000 php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement