Skip to content

Commit bcc341a

Browse files
authored
add FallbackResource alternative for assets/bundles in nginx
1 parent e9cde48 commit bcc341a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup/web_server_configuration.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ The **minimum configuration** to get your application running under Nginx is:
287287
# try to serve file directly, fallback to index.php
288288
try_files $uri /index.php$is_args$args;
289289
}
290+
291+
# optionally disable falling back to php script for the asset directories
292+
# which will allow nginx to return a 404 error when files are
293+
# not found instead of passing the request to Symfony
294+
location /bundles {
295+
try_files $uri $uri/ =404;
296+
}
290297
291298
location ~ ^/index\.php(/|$) {
292299
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

0 commit comments

Comments
 (0)