docker-compose nginx not found route for symfony assets docker-compose nginx not found route for symfony assets nginx nginx

docker-compose nginx not found route for symfony assets


you should have existing file /var/www/html/site/web/css/main.css! Do you have it?

Nginx config should not pass this request /css/main.css to PHP code. It should simply send existing file to browser.I think you have this file, but on another path.

You shold correct nginx configuration for it, or put assets-files in /var/www/html/site/web/ directory


Much more could be said but: the assets were blocked at the the php-fpm (symfony's) container.

In the container's file www.conf (in my case /usr/local/etc/php-fpm.d/www.conf ) check the directive security.limit_extensions and leave it like this

security.limit_extensions = 

Note: I found it commented like this ;security.limit_extensions = .php .php3 .php4 .php5


Your main problem is, nginx is searching the asset files in nginx container. After you install your assets using (app/console assets:install) they will copied into your php (symfony) container. You must link the assets them between containers. There is an answer to do that: https://stackoverflow.com/a/44284993/6279901