You can now do it with this in the domain configuration
#URL Friend
location / {
if ($request_uri ~ ^/(.*)\.html$)
{ return 302 /$1; }
try_files $uri $uri/ $uri.html $uri.php?$args; }
location ~ \.php$
{ if ($request_uri ~ ^/([^?]*)\.php($|\?))
{ return 302 /$1?$args; }
try_files $uri =404;
}