1. Caddy version (caddy version
):
v2.4.5
2. How I run Caddy:
a. System environment:
Ubuntu, systemctl, xmlrpc, libtorrent
b. Command:
caddy validate
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
default_sni africanarchers.com
email rehcram@gmail.com
}
https://africanarchers.com {
root * /var/www
file_server
encode gzip
header Cache-Control "no-cache"
php_fastcgi unix//run/php/php7.4-fpm.sock
route /auth* {
auth_portal {
local_backend /etc/caddy/auth/local/users.json
jwt_token_file 1 /etc/caddy/auth/local/jwt_privatekey.pem
ui {
links {
"Tautulli" /tautulli
"ruTorrent" /rutorrent
"Sonarr" /sonarr
"Radarr" /radarr
"Lidarr" /lidarr
"Resillio Sync" /sync
}
}
}
}
@protected not path /favicon.ico /public* /tautulli/api*
route @protected {
jwt {
primary yes
user_identity subject
trusted_public_key 1 /etc/caddy/auth/local/jwt_publickey.pem
}
}
@logout path_regexp /logout$
rewrite @logout /auth/logout
@restricted path_regexp /\.(git|htaccess)|/rutorrent/(conf|share)
respond @restricted 404
reverse_proxy /sonarr* 127.0.0.1:8989
reverse_proxy /radarr* 127.0.0.1:7878
reverse_proxy /lidarr* 127.0.0.1:8686
reverse_proxy /tautulli* 127.0.0.1:8181
@rslsync path /sync* /gui*
route @rslsync {
jwt
redir /sync /sync/
uri replace /sync/ /gui/
reverse_proxy 127.0.0.1:8888
}
}
http://localhost {
root * /var/www
file_server
encode gzip
php_fastcgi unix//run/php/php7.4-fpm.sock
}
http://africanarchers.com/public* {
root * /var/www
file_server
encode gzip
php_fastcgi unix//run/php/php7.4-fpm.sock
}
http://africanarchers.com {
redir https://{host}{uri}
}
3. The problem I’m having:
I use systemctl enable --now caddy.service and all appears fine. However the next step is to get some log in credentials using systemctl enable --now caddy.service. Output from this includes an error "n ExecStart= process belonging to unit caddy.service has exited.
– The process’ exit code is ‘exited’ and its exit status is 226.
Nov 03 20:49:51 33Tmedia systemd[1]: caddy.service: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd"
4. Error messages and/or full log output:
When I use caddy validate I get the following error message “using adjacent Caddyfile
validate: adapting config using caddyfile: parsing caddyfile tokens for ‘route’: Caddyfile:29 - Error during parsing: unrecognized directive: auth_portal - are you sure your Caddyfile structure (nesting and braces) is correct?”
5. What I already tried:
OK, so I am a noob here. Please don’t shoot me. I am trying to follow the instructions for a torrent build here - Home · t0phux/ultimate-torrent-setup Wiki · GitHub. I am new to Linux and have never used Caddy. One of the steps in instructions had a script to update caddy using github.com/greenpau/caddy-auth-jwt. It appears that this is now github.com/greenpau/caddy-authorize so I built it with that. Now I am stuck with the above caddyfile. (When I use a very basic caddyfile and curl, the caddyfile works so I assume that at least caddy is working?)
Now I am stuck and any help / advice to help me learn would be appreciated.