look at our ssl template it demonstrates how to make a replace rule in pups that amends nginx config.