{% for location in gones %} location /{{ location }} { return 410; } {% endfor %} {% for location in gones_re %} location ~ {{ location }} { return 410; } {% endfor %} {% for from, to in redirects.items() %} location /{{ from }} { return 301 {{ to }}; } {% endfor %} {% for source, target in rewrites.items() %} rewrite {{ source }} {{ target}} permanent; {% endfor %}