This is a long shot. I’ve been stuck on this for 8 hours or so and I can’t seem to figure out the issue. I have an angular frontend which i want to connect to my api-platform backend. I have a LAMP stack that is working wonderfully, however, I want to play around with vulcan so i have been exploring caddy+frankenphp.
My LAMP stack is setup like so:
angular is at site.[com] (/app/angular/public)
api-platform is at site.[com]/api. ( alias to /app/api/public)
This is what my vhost looks like and it works fine.
ServerName site.com
DocumentRoot "/app/angular/public"
<Directory /app/angular/public>
Options Indexes ExecCGI SymLinksIfOwnerMatch FollowSymlinks MultiViews
AllowOverride All
Require all granted
</Directory>
Alias "/api" "/app/api/public"
<Directory "/app/api/public">
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted
</Directory>
## Logging
</VirtualHost>
When I try to convert this to a CaddyFile equivalent I’m running into an issue with my api side of things. My CaddyFile below serves up the angular site just fine. When I try to access site.com/api I’m getting a symfony error No route found for “GET site.com/api/”, which is strange because on my LAMP stack this works, I’m thinking this is a rewrite issue and I can’t seem to figure out the problem.
//CaddyFile
site.com {
# Serve Angular frontend from this path
tls /certs/certificate.crt /certs/private.key
//I also tried handle_path, same results.
handle /api/* {
root * /app/api/public
try_files {path} /index.php
php_server
}
handle {
root * /app/angular/public
try_files {path} /index.html
file_server
}
}
If I modify the caddy file to the following, my API serves up fine at site.[com].
site.com {
# Serve Angular frontend from this path
tls /certs/certificate.crt /certs/private.key
handle {
root * /app/api/public
php_server
}
}
Anyone have any ideas as to whats causing my problem?