From 8958f6c3f64463cebb964b628b354bbe1f6ad9f6 Mon Sep 17 00:00:00 2001 From: fliespl Date: Fri, 9 Aug 2019 10:07:16 +0200 Subject: [PATCH] add FallbackResource alternative for assets/bundles in nginx --- setup/web_server_configuration.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup/web_server_configuration.rst b/setup/web_server_configuration.rst index be3e58c0d67..536fb4bb1f3 100644 --- a/setup/web_server_configuration.rst +++ b/setup/web_server_configuration.rst @@ -294,6 +294,13 @@ The **minimum configuration** to get your application running under Nginx is: # try to serve file directly, fallback to index.php try_files $uri /index.php$is_args$args; } + + # optionally disable falling back to php script for the asset directories + # which will allow nginx to return a 404 error when files are + # not found instead of passing the request to Symfony + location /bundles { + try_files $uri $uri/ =404; + } location ~ ^/index\.php(/|$) { fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;