Strange issue with Lighttpd and PHP


I’ve encountered a strange issue - I have 3 SBC with DietPi. All of them have Lighttpd and PHP installed and running. On all of them I have a fsvg.php page which executes ‘duf’ command and show the output in svg format. SBC #1 has another php file which displays all three SVGs.

Everything was working as intended. Tonight, I found out that images from SBC #2 & #3 are not working. If accessed directly by browser - I get 404 error.

Now things get interesting:

  1. If I rename that file from fsvg.php to something.php - it works
  2. If I rename another working php file to fsvg.php - it stops working
  3. If I open console and type: php fsvg.php - it works.

I’ve never touched any PHP settings.
Lighttpd server has mods alias, setenv and rewrite enabled.
Only difference between SBC #1 and other two is additional alias and url rewrite rules in lighttpd.conf on SBC #2 & #3:

#mod_alias redirects
alias.url = ( "/fs" => "/mnt/storage/data/filesrv/" )
alias.url += ( "/dl" => "/mnt/storage/data/downloads/" )

# Add trailing slash to directories, excluding files with extensions
url.rewrite-if-not-file = (
  "^(.*)[^/]$" => "$1/",

# Do not add trailing slash to files with extensions or URLs with query parameters
url.rewrite-once = (
  "^/.*(\?.*)?$" => "$0",

#mod_setenv rule
setenv.add-response-header = (
    "Access-Control-Allow-Origin" => "*",
    "Access-Control-Allow-Methods" => "HEAD, GET, POST, PUT, DELETE, OPTIONS",    
    "Access-Control-Allow-Headers" => "Content-Type, Origin, Accept, Range, Cache-Control, Cookie",
    "Access-Control-Expose-Headers" => "Content-Range, Date, Etag, Cache-Control, Last-Modified",
    "Access-Control-Allow-Credentials" => "true",
    "Timing-Allow-Origin" => "*"


I have no idea what’s going on. I renamed a fsvg.php so it could continue functioning but would like to figure out what has happened here.

If anyone could shed some light on the matter - please do.

Best Regards to all