I was trying to add
try_files $uri $uri/ /yourls-loader.php?$args;
to the location /, till I found that the right place for it was in the /etc/nginx/common/php.conf (it’s a yourls installation).
But I feel this is not the best place to do that, since it can be gone in an upgrade.
Is there a right place to add this without getting the “duplicate location” error?