[NGINX] Disallow php execution in storage - fourslickz/notes GitHub Wiki

        location ~ /storage/.*\.php$ {
                return 403;
        }

Place those lines before these lines.

        location / {
                try_files $uri $uri/ /index.php?$query_string;

        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }