You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default nginx.conf contains the following configuration
# Some basic cache-control for static files to be sent to the browser
location ~* \.(?:ico|css|js|gif|jpeg|jpg|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
which doesn't work with frameworks like Drupal. In some scenarios, example: the framework aggregates CSS and JS files, creates thumbnails of uploaded images.
These aggregate CSS/JS files, generated thumbnails etc. don't get created in the first place as the above configuration prevents nginx from doing so.
Describe the Enhancement
If this section is removed from the nginx configuration, the above scenarios work and the files do get created.
Possible Solution
This section could be toggled based on a build-time env variable, very similar to BP_PHP_ENABLE_HTTPS_REDIRECT.
Something like BP_PHP_ENABLE_CACHE_CONTROL whose default value is true.
Another simpler solution is to remove this section entirely, so that the buildpack users can add to their overridden nginx configs if they need it.
I've tested both approaches locally and they seem to work. Happy to raise a PR on whatever route we agree upon. I'm slightly biased towards the 2nd approach.
Motivation
Drupal is a major PHP framework and making this change will make Paketo work with Drupal 8,9 and 10. This is also an opportunity to make nginx configuration more barebones.
The text was updated successfully, but these errors were encountered:
The default
nginx.conf
contains the following configurationwhich doesn't work with frameworks like Drupal. In some scenarios, example: the framework aggregates CSS and JS files, creates thumbnails of uploaded images.
These aggregate CSS/JS files, generated thumbnails etc. don't get created in the first place as the above configuration prevents nginx from doing so.
Describe the Enhancement
If this section is removed from the nginx configuration, the above scenarios work and the files do get created.
Possible Solution
This section could be toggled based on a build-time env variable, very similar to
BP_PHP_ENABLE_HTTPS_REDIRECT
.Something like
BP_PHP_ENABLE_CACHE_CONTROL
whose default value istrue
.Another simpler solution is to remove this section entirely, so that the buildpack users can add to their overridden nginx configs if they need it.
I've tested both approaches locally and they seem to work. Happy to raise a PR on whatever route we agree upon. I'm slightly biased towards the 2nd approach.
Motivation
Drupal is a major PHP framework and making this change will make Paketo work with Drupal 8,9 and 10. This is also an opportunity to make nginx configuration more barebones.
The text was updated successfully, but these errors were encountered: