drupal-with-nginx
drupal-with-nginx copied to clipboard
Adv CSS/JS Agg Issue
If someone has troubles with Adv CSS/JS Agg and in status report sees
The web servers configuration will need to be adjusted. The server should have responded with a 304, instead a 200 was returned.
So I've adjusted config replacing this in drupal.conf
## Advanced Aggregation module CSS
## support. http://drupal.org/project/advagg.
location ^~ /sites/default/files/advagg_css/ {
expires max;
add_header ETag '';
add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
add_header Accept-Ranges '';
location ~* /sites/default/files/advagg_css/css[_[:alnum:]]+\.css$ {
access_log off;
try_files $uri @drupal;
}
}
## Advanced Aggregation module JS
## support. http://drupal.org/project/advagg.
location ^~ /sites/default/files/advagg_js/ {
expires max;
add_header ETag '';
add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
add_header Accept-Ranges '';
location ~* /sites/default/files/advagg_js/js[_[:alnum:]]+\.js$ {
access_log off;
try_files $uri @drupal;
}
}
With this as it is suggested in official Advagg docs
###
### advagg_css and advagg_js support
###
location ~* files/advagg_(?:css|js)/ {
gzip_static on;
access_log off;
expires max;
add_header ETag "";
add_header Cache-Control "max-age=31449600, no-transform, public";
try_files $uri @drupal;
}
@kybarg thanks! I think it's because not all sites are configured to store files in /sites/default folder
Commenting out add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT'; worked for me.
Can confirm replacing the nginx config with code in comment 1 works. Just commenting out the Last-Modified header didn't.