1. The problem I’m having:
Im trying to convert a (simple) .htaccess to a caddy file, but i stucked. The original htaccess is the following
RewriteEngine On
RewriteCond %{REQUEST_URI} admin/uploads/.*
RewriteRule ^admin/uploads/(.*)$ uploads/$1 [L]
RewriteCond %{REQUEST_URI} admin/gate/.*
RewriteRule ^admin/gate/(.*)$ gate/$1 [L]
this application is installed in an subdirectory called /map
so i write the following in the Caddyfile
rewrite /map/admin/uploads/(.*) /uploads/{1}
rewrite /map/admin/gate/(.*) /gate/{1}
2. Error messages and/or full log output:
PHP communicaton error
If i use apache it works, so i am pretty sure that i misconfigured something
3. Caddy version:
My version:
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
a. System environment:
I have installed caddy with Ubuntu 20.04 (package). The Service is running with systemd
b. Command:
systemctl status caddy
d. My complete Caddy config:
my.domain.tld {
root * /var/www/my.domain.tld/docs
file_server
encode gzip
log {
level error
output file /var/www/my.domain.tld/logs/access.log
}
php_fastcgi unix//run/php/php7.4-fpm.appintern.sock
rewrite /map/admin/uploads/(.*) /uploads/{1}
rewrite /map/admin/gate/(.*) /gate/{1}
}