nginx conf on docker same for xampp

I’m following a youtube tutorial on how to setup docker with PHP. I came across this code for nginx configuration.

server {
    listen 80;
    server_name localhost;
    root /app/public;
    index index.php;

    location ~ .php$ {
       fastcgi_pass   app:9000;
       fastcgi_index  index.php;
       fastcgi_param REQUEST_METHOD $request_method;
       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
       include        fastcgi_params;
    }

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

I’m wondering how can I setup this configuration to work the same way with xampp.

For example now. if I go to localhost/un-known-text it redirects back to index.php which is not the default behaviour of xampp.

Any help would be appreciated.