CSS and JS returns 404 when enabling css and js aggregation on nginx

Created on 11 July 2023, over 1 year ago
Updated 4 April 2024, 9 months ago

I am running wodby docker stack on my local environment.

When running Drupal 10.1.1 on nginx server, when I enable css and js aggregation on a contributed theme like bootstrap or bootstrap_bario, I get 404 errors when the browser tries to access the aggregated css and js.

I have tried adding

# Passes image style and asset generation to PHP.
location ~ /sites/.*/files/(css|js|styles)/ {
  try_files $uri @rewrite;
}

and

# Passes image style and asset generation to PHP.
location ~ /var/www/html/web/sites/.*/files/(css|js|styles)/ {
  try_files $uri @rewrite;
}

to my locations.conf as well as adding NGINX_SERVER_EXTRA_CONF_FILEPATH: /var/www/html/locations.conf to my docker-compose.yaml

💬 Support request
Status

Closed: works as designed

Version

10.1

Component
Asset library 

Last updated about 24 hours ago

No maintainer
Created by

🇬🇧United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024