Created
January 3, 2024 12:38
-
-
Save Christilut/7b009310b44d638db99034d72d8ecee2 to your computer and use it in GitHub Desktop.
Caddy 2 configuration for Sendy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sendy.example.com { | |
root * /var/www/sendy | |
encode gzip | |
file_server | |
php_fastcgi unix//run/php/php-fpm.sock { | |
split .php | |
index index.php | |
} | |
try_files {path} {path}.php | |
# Enable rewrite rules for Sendy | |
@w path_regexp w ^/w/([a-zA-Z0-9/]+)$ | |
rewrite @w w.php?i={re.w.1} | |
@l path_regexp l ^/l/([a-zA-Z0-9/]+)$ | |
rewrite @l l.php?i={re.l.1} | |
@t path_regexp t ^/t/([a-zA-Z0-9/]+)$ | |
rewrite @t t.php?i={re.t.1} | |
@unsub path_regexp unsub ^/unsubscribe/(.*)$ | |
rewrite @unsub unsubscribe.php?i={re.unsub.1} | |
@sub path_regexp sub ^/subscribe/(.*)$ | |
rewrite @sub subscribe.php?i={re.sub.1} | |
# Configure logging (optional) | |
log { | |
output file /var/log/caddy/sendy.log | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment