Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx rule for Laravel livewire file previews in Laravel template #97

Closed
afraazali opened this issue Nov 7, 2024 · 0 comments
Closed

Comments

@afraazali
Copy link

When using Laravel Livewire, there's a route that serves temporary URL's for images. The current nginx configuration tries to serve this as a static asset, due to the NGINX_STATIC_EXT_REGEX variable.

An example URL would look something like:

`http://example.docker.localhost/livewire/preview-file/r749ij99RQtR3drbNwm4Rur1Yb8qcS-metadGVzdC5qcGc=-.jpg?expires=1731020399&signature=5629fe3d3ab274a1db61976b12b24c53a28ba3084979d38ce5619cf2e95d2465

The current workaround is to simply remove jpe?g from the NGINX_STATIC_EXT_REGEX variable. Another work around is to create your own preset.

Would it be possible to add the follow location directive to the laravel preset:

location ~* /livewire/preview-file {
    expires off;
    try_files $uri /index.php?$args;
}

Adding the above works, but I'm not sure it's the most efficient or correct way of handling the use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant