I am using the Generate Press WP theme, which has an option to generate an external stylesheet for dynamic CSS (for the options generated by the customizer). Sometimes I get 502 errors for the generated stylesheet after making a change in the customizer which resolves itself after a few minutes.
It doesn't happen every time I save settings in the customizer, only sometimes.
This is the error message I am getting in the error log when this happens.
2020/12/01 20:44:35 [alert] 43690#43690: *18956 pread() read only 6064 of 6215 from "/var/www/example.com/htdocs/files/generatepress/style.min.css" while sending response to client, client: x.x.x.x, server: example.com, request: "GET /files/generatepress/style.min.css?ver=1606877048 HTTP/2.0", host: "example.com", referrer: "
https://example.com/test-page.html"
I think it might be caused by the open_file_cache settings in nginx.conf, but I'm not really sure. Unlike other stylesheets, this one is uploaded to the media folder. I changed my WP media folder to 'files' instead of wp-content/uploads, so the location is:
/var/www/example.com/htdocs/files/generatepress/style.min.css
Could the location where the file is stored have anything to do with this? When I edit other css files this never happens, only with that specific one that gets automatically generated by changing the customizer options.
Any ideas on how to prevent this from happening?