I deployed a Laravel project that uses Livewire and Filament PHP on aaPanel.
The app loads fine and the login page is displayed, but the Livewire & Filament assets (CSS/JS) were not loading and returning 404 when I inspect element.
Example:
GET https://domain.com/livewire-1233c4f/livewire.js?id=cfc5c net::ERR_ABORTED 404 (Not Found)
At first I thought it was:
but everything looked OK.
NGINX rewrite was not handling /livewire and /filament paths.
Add this into your site config:
location ^~ /filament {
try_files $uri $uri/ /index.php?$query_string;
}
location ^~ /livewire {
try_files $uri $uri/ /index.php?$query_string;
}
Reload / Restart the NGINX and the assets will load normally.
Sharing this here in case anyone deploying Laravel + Livewire + Filament on aaPanel hits the same issue 👍
