Rewrite the nginx config template in Python.