Permalinks error when using NGINX

Hi,

If I use Apache or no permalinks the following URL works OK https://www.mydomain.com/item/edit/146261/

When I use NGINX other URL’s work OK but https://mydomain.com/item/edit/146261/ gives a 404 error.

I’m using for my NGINX directive:

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

Can anyone suggest a solution?

Many thanks