1. Caddy version (caddy version
):
v2.4.6
2. How I run Caddy:
Service
a. System environment:
Ubuntu
b. Command:
Paste command here.
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:
sendy.example.org {
root * /var/www/sendy
tls foo@example.org
php_fastcgi /run/php/php7.0-fpm.sock {
split .php
index index.php
}
try_files {path} {path}.php
@catch {
path_regexp ^/([a-zA-Z0-9-]+)$
}
rewrite @catch {path}.php
#rewrite ^/w/([a-zA-Z0-9/]+)$ w.php?i={query}
#rewrite ^/l/([a-zA-Z0-9/]+)$ l.php?i={query}
#rewrite ^/t/([a-zA-Z0-9/]+)$ t.php?i={query}
#rewrite ^/unsubscribe/(.*)$ unsubscribe.php?i={query}
#rewrite ^/subscribe/(.*)$ subscribe.php?i={query}
}
V1 config:
sendy.example.org {
root /var/www/sendy
tls foo@example.org
# PHP-FPM Configuration for Caddy
fastcgi / /run/php/php7.0-fpm.sock php {
ext .php
split .php
index index.php
}
rewrite {
r ^/([a-zA-Z0-9-]+)$
to {1}.php
}
rewrite {
r ^/w/([a-zA-Z0-9/]+)$
to w.php?i={1}
}
rewrite {
r ^/l/([a-zA-Z0-9/]+)$
to l.php?i={1}
}
rewrite {
r ^/t/([a-zA-Z0-9/]+)$
to t.php?i={1}
}
rewrite {
r ^/unsubscribe/(.*)$
to unsubscribe.php?i={1}
}
rewrite {
r ^/subscribe/(.*)$
to subscribe.php?i={1}
}
}
3. The problem I’m having:
Not able to migrate from v1 to v2 config for Sendy PHP rewrites. I’m a bit confused by the documentation and don’t find any example for Sendy or other similar PHP applications.