Hello,
I’m using the latest dockerfile from fly to laravel.
I just want to use cache max-age=31536000 of nginx.
Idk how to do !
Any help will be welcome.
Thanks you
Hello!
The files used to create the base Docker image are here: GitHub - fly-apps/laravel-docker: Base Docker images for use with Laravel on Fly.io
For your case, I would
- Copy this Nginx config file: https://github.com/fly-apps/laravel-docker/blob/main/src/nginx/sites-available/default
- Save it to the
.fly
directory in your code, generated byfly launch
(e.g..fly/default
) - Adjust the downloaded file to add your cache header (perhaps on static assets only?)
- Add a line to your
Dockerfile
to copy your new config file and replace the default one:
RUN cp .fly/default /etc/nginx/sites-available/default
Add that near line 86 or so of the Dockerfile.
I’m assuming you’re not using Octane. There’s a separate file
default-octane
to edit/copy if you’re using Octane.
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.