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.
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: laravel-docker/default at main · fly-apps/laravel-docker · GitHub
- Save it to the
.flydirectory in your code, generated by
- Adjust the downloaded file to add your cache header (perhaps on static assets only?)
- Add a line to your
Dockerfileto 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-octaneto edit/copy if you’re using Octane.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.