Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

daveb2's avatar
Level 3

Forge nginx config not refreshing static files

Has anybody else run into this issue? We host a lot of training modules that we create using Articulate Rise 360. Basically an online tool that code-generates a static htm file with a lot of javascript assets and embedded base64-encoded content that gets unpacked at runtime.

The problem we're having is that when we update these modules and re-publish them, the modified index file is copied over the top of the old one, and nginx continues serving the older copy until the server is restarted. Not ideal.

I have tried disabling sendfile altogether with sendfile off, but that didn't fix the issue.

I am about to start mucking about with open_file_cache in the hope that I can make some difference. If that fails I guess I'll try to exclude the files from the cache entirely with ACL rules.

Has anybody else seen this behaviour? It doesn't affect newly-created files, only changed files.

0 likes
2 replies
daveb2's avatar
Level 3

To clarify, this issue appears to only affect .php files. I can modify the contents of a .txt file or .htm file and see the results reflected in the browser immediately. However, when I change a .php file, I need to reboot the server in order to see the changes (nginx reload or force-reload doesn't make a difference).

daveb2's avatar
Level 3

Well, in the end this proved too difficult. No matter what I do (restarting web server VMs completely) the page remains cached. I am just going to work around the issue by using a unique hash (timestamp, probably) in the path each time I update. Not ideal, but reliable.

Please or to participate in this conversation.