标签:jsp url efault tps 5.0 模版 template releases reload
下载confd#wget https://github.com/kelseyhightower/confd/releases/download/v0.15.0/confd-0.15.0-linux-amd64
#mv confd-0.15.0-linux-amd64 /usr/bin/confd
#chmod +x /usr/bin/confd
?
conf.d 目录中是应用的配置文件定义
templates 目录中是应用的模版文件
confd.toml 是confd本身的配置文件
mkdir -p /etc/confd/{conf.d,templates}
root@747f14c47586:/etc/confd/conf.d# cat nginx.toml
[template]
src = "nginx.conf.tmpl"
dest = "/etc/nginx/conf.d/default.conf"
keys = [ "/netm/url" ]
check_cmd = "/etc/init.d/nginx configtest"
reload_cmd = "/etc/init.d/nginx reload"
root@747f14c47586:/etc/confd/templates# cat nginx.conf.tmpl
server {
listen 80;
location /netm/index.jsp {
rewrite ^(.*)$ {{ getv "/netm/url" }} redirect;
expires 1s;
}
}
标签:jsp url efault tps 5.0 模版 template releases reload
原文地址:http://blog.51cto.com/f1yinsky/2296397