fly-apps / laravel-docker

Base Docker images for use with Laravel on Fly.io
43 stars 8 forks source link

fix try_files for assets served from PHP on Octane #3

Closed jonathan-lewerissa closed 1 year ago

jonathan-lewerissa commented 1 year ago

Hi!

This PR tries to fix a problem where serving assets using PHP with Octane is not redirecting properly.

I recently tried to make a new project using Laravel and Filament. On a freshly installed Laravel app served using Octane, the assets for the Filament app are not loaded properly, resulting in 404s. The assets for Filament are loaded dynamically, and the nginx configuration for Octane is not redirecting the request properly.

This PR tries to fix this problem by replacing /index.php?$query_string with @octane in the try_files section.

Thank you!

fideloper commented 1 year ago

Seems like a solid idea, thanks!