Здравствуйте. Подскажите, где ошибка в шаблоне Jinja 2?
server {
listen 80;
{{ssl}}
charset {{vhost.charset}};
root /home/u{{vhost.userid}}/web/{{vhost.mainname}};
index {{vhost.index}};
{% if aliases is defined %}
server_name {{vhost.mainname}} www.{{vhost.mainname}} {{aliases}};
{% else %}
server_name {{vhost.mainname}} www.{{vhost.mainname}};
{% endif %}
{% if errorpages.len() >0 %}
{% for page in errorpages %}
error_page {{page.type}} {{page.url}}
{% endfor % }
{% endif %}
{% if redirects.len() >0 %}
{% for item in redirects %}
location = {{item.from}} {
return {{item.type}} {{item.to}}
}
{% endfor % }
{% endif%}
location / {
try_files \$uri \$uri/ /{{;
}
location ~ /\.ht {
deny all;
}
{% if mode=='nginx %}
location ~ \.php$ {
try_files \$uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php{{php}}-{{siteuser}};
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
{% elif mode=='apache' %}
location ~ \.php$ {
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header Host \$host;
proxy_pass http://127.0.0.1:81;
}
location ~ /\.ht {
deny all;
}
{% endif %}
}