Solution
The explnation by voleger β in #19 π¬ Aggregation not working css and js cache directories not being created Postponed: needs info was applicable in my case also, but with Apache 2.4.58 fcgi Docker container, instead of Nginx, and newly installed (not upgraded) Drupal 10 (10.2.1) with PHP 8.2.14 FPM/FastCGI in another container.
The solution was to add these lines into the Apache virtual host:
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ fcgi://drupal-php-fpm:9000%{REQUEST_URI} [P,QSA,L]
Discussion about this method:
https://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
Workaround
For someone unable to change server configuration:
- Installing and enabling the Advagg module makes the site work without the config change for the server.
- The aggregate CSS and JS boxes must be unchecked.
- The caches must be rebuilt with Advagg installed for the changes to take effect.
So, nothing to do with Drupal configuration nor Drush nor file/folder permissions.