Can't disable statics once enabled

Hi,

I deployed an nginx image containing some static files and deployed it with statics enabled. I then removed the statics section and redeployed, when requests to the service still return responses with headers that look like statics is still enabled.

fly-cache-status: HIT
server: Fly/5d323ef (2021-10-12)
via: 1.1 fly.io
fly-request-id: 01FJGR6VZA9HMERF9BFCQ0TENJ

Sorry we missed this. This sounds like a bug where statics not being present in the config are causing them to be skipped instead of overwritten. Can you try adding this to the config to see if an empty array of statics clears it?

[[statics]]

Hi Michael, I stopped using statics on the app I ran into this problem with, and it isn’t easy to test because I moved the static files inside the binary now.

However, I think what you’ve described sounds right. How I ended up forcing the statics to clear was I deployed with random statics in my fly.toml:

[[statics]]
  guest_path = "/asdfasdf"
  url_prefix = "/asdfasdf"

After I deployed that, the previous statics were cleared. I guess my app still probably has the asdfasdf statics config deployed, but it doesn’t matter.

1 Like