updated detect script to handle different nginx config locations