テンプレートの使いどころ
nginx.confを書くのにテンプレート使いたいなー。
<%* 静的サイト達 *%>
<%foreach from=sites item=site %>
#
# <%$site%>
#
server {
listen 80;
server_name <%$site%>
access_log logs/<%$site%>.access.log main;
location / {
root <%$sites_top%>/<%$site%>;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
}
<%/foreach%>デリミタが'{'と'}'はさすがにダメだから、'<%'と'%>' とかだろう。