Running Laravel behind Traefik as reverse proxy, with a Path Prefix (eg /api/
=> Laravel).
Laravel is served by Nginx and Php-fpm.
Laravel use Symfony HTTP foundation
to generate route URL.
Symfony is not seeing correctly the base path, and generate URL without /api/
prefix.
As a dirty workaround, I fixed it by doing as the 1st line on index.php:
$_SERVER['SCRIPT_NAME'] = '/api/' . $_SERVER['SCRIPT_NAME'];
How can I force the full URL or the base path?