Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############################## Common.conf example for Caddy Server v0.10.x ###################################
- # Notes: (Last edit: 1/08/18)
- # You import this file into caddy server v0.10.x allowing you to share directives between server blocks
- # Should allow you to have a cleaner caddyfile since you're not repeating common directives for each server
- # "caddyfile" config example v0.10.x: https://pastebin.com/bLVJ4vsN
- # Removed php startup directive since it'll startup a new instance each time the conf is imported (Moved directive to caddyfile)
- # Removed HSTS "includeSubDomains; preload" and "-Server" from header block
- # 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!
- # Old caddyfile v0.9.x (Deprecated but has more notes and setup information if needed without using a common.conf file!)
- # https://pastebin.com/sFUdPFvM
- # Added needed rewrite code for OMbi V3
- # Change all path "syntax" & "locations" to match your OS! e.g. "c:\caddy\www" for Windows or "/var/www" for nix file systems
- ########################################### Code starts below #################################################
- ext .html .htm .php
- root /caddy/www # Change path syntax for your OS or your preferred location!
- gzip
- header / {
- X-Content-Type-Options nosniff
- X-XSS-Protection "1; mode=block"
- Strict-Transport-Security "max-age=31536000;"
- }
- # New log directive syntax for v0.10.x
- log /caddy/logs/access.log { # Change path syntax for your OS or your preferred location!
- rotate_size 1 # Rotate after 1 MB
- rotate_age 7 # Keep log files for 7 days
- rotate_keep 2 # Keep at most 2 log files
- }
- errors /caddy/logs/error.log { # Change path syntax for your OS or your preferred location!
- rotate_size 1 # Set max size 1 MB
- rotate_age 7 # Keep log files for 7 days
- rotate_keep 2 # Keep at most 2 log files
- }
- # You can normally use "127.0.0.1", use "Host IP" address if your running the web server or the apps on different machines
- proxy /sabnzb 127.0.0.1:8080 { # https://sabnzbd.org/
- transparent
- }
- proxy /htpc 127.0.0.1:8085 { # http://htpc.io/
- transparent
- }
- proxy /headphones 127.0.0.1:8181 { # https://github.com/rembo10/headphones
- transparent
- }
- proxy /mylar 127.0.0.1:8090 { # https://github.com/evilhero/mylar
- transparent
- }
- proxy /lazy 127.0.0.1:5299 { # https://github.com/DobyTang/LazyLibrarian
- transparent
- }
- proxy /emby 127.0.0.1:8096 { # https://emby.media/
- transparent
- }
- proxy /sonarr 127.0.0.1:8989 { # https://sonarr.tv/
- transparent
- }
- # Headphones uses port 8181 so make sure there's no conflict!
- proxy /plexpy 127.0.0.1:8181 { # https://github.com/JonnyWong16/plexpy
- header_upstream X-Forwarded-Host {host}
- transparent
- }
- proxy /nzbget 127.0.0.1:6789 { # http://nzbget.net/
- transparent
- }
- proxy /couch 127.0.0.1:5050 { # https://couchpota.to/
- transparent
- }
- proxy /nzbhydra 127.0.0.1:5075 { # https://github.com/theotherp/nzbhydra
- transparent
- }
- # New rewrite rule needed to load some of Ombi V3's assets
- rewrite {
- r ^/dist
- to /ombi/{uri}
- }
- proxy /ombi 127.0.0.1:3579 { # https://github.com/tidusjar/Ombi
- transparent
- }
- # The rewrite makes sure all of glances sub directory calls are proxied from domain to host
- rewrite {
- if {>Referer} has /glances
- to /glances/{path}
- }
- # The code below gives you a tiny level of security requiring a username/password before Caddy will let you connect to it
- basicauth /glances Username Password
- proxy /glances 127.0.0.1:61208 { # https://github.com/nicolargo/glances
- without /glances
- transparent
- }
- proxy /deluge 127.0.0.1:8112 { # http://deluge-torrent.org/
- without /deluge
- transparent
- header_upstream X-Deluge-Base "/deluge"
- }
- proxy /watcher 127.0.0.1:9090 { # https://github.com/nosmokingbandit/Watcher3
- transparent
- }
- proxy /radarr 127.0.0.1:7878 { # https://github.com/Radarr/Radarr
- transparent
- }
- # The code below will proxy PHP requests
- fastcgi / 127.0.0.1:9000 php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement