How to remove .php extension (Nginx)

Hi

I know LBF is for WordPress sites but a few of my client sites only require WordPress for blog pages, so I have WordPress in a subdirectory, they call it headless WordPress right?

Is there a way to gracefully remove the .php extension using the etc/nginx/site.conf ?

I want to change http://example.com/about-page.php, to http://example.com/about-page/

I tried adding location blocks that I found on stack overflow but it didn’t work.

Cheers.

Mike