Your case may vary, but I had the following situation;
Customer has a monitoring solution, Monitorix, which they want to be available under their aegir host. Sure you can add the lines to the ~aegir/config/server_master/nginx/vhosts.d/domain.com.conf, but every time the hostmaster site is verified, you will have to re-add the necessary config lines. What a pain in the ass.
A better way is to create a custom drush module, containing the correct hook.
Here’s my ~aegir/.drush/kit.drush.inc
Don’t forget to chmod +x ~aegir/.drush/kit.drush.inc so that Drush will be able to run your module
A few gotchas;
- Line 3: You must begin your function name with the same string that you started the drush file as. In my case, I used kit. You can use something equally as cool.
- Line 3: If you’re using Apache instead of nginx, you should alter the function name and replace nginx with apache.
- Line 4: You should change host.example.com to your aegir host.
Now, when a site is verified, and it’s hostname is host.example.com, the module will return the array containing the necessary config lines, which is then added to the config files located in ~aegir/config/server_master/nginx/vhosts.d/