Add custom settings in nginx's server blocks

Hello

I would like to add a custom location block in ALL my nginx config files (and I have got a lot).
For this, I write something like you have done here : https://github.com/Eugeny/ajenti-v/commit/d07fa6608fd933cc91290fe5d6b56bf2e0e6f6dd

Is it good ? :-)
Thanks !