Hi all, I’ve just transferred my Caddy server (almost 20 sites) to v2 with almost no trouble, thank you so much for this wonderful server!
I’ve got one hiccup, which is mostly I think because I haven’t quite got my head around the new rewrite directive.
What I’m trying to achieve:
- All requests to site.net/* go to index.php?{query} (which works great!)
-
Except requests to site.net/blog/* (which should do the same, but to the subdirectory
/blog
).
Here’s my attempt:
site.net www.site.net {
file_server
root * /var/www/site.net
php_fastcgi unix//run/php/php7.2-fpm.sock
try_files {path} {path}/ /index.php?{query}
try_files /blog/{path} {path}/ /blog/index.php?{query}
encode gzip
}
Needless to say, this doesn’t work - the second try_files
seems to overwrite the first, so all requests get channeled to /blog
.
What am I missing?