Laravel custom Nginx

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


The files used to create the base Docker image are here: GitHub - fly-apps/laravel-docker: Base Docker images for use with Laravel on

For your case, I would

  1. Copy this Nginx config file:
  2. Save it to the .fly directory in your code, generated by fly launch (e.g. .fly/default)
  3. Adjust the downloaded file to add your cache header (perhaps on static assets only?)
  4. 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.