使用etcd+confd管理nginx配置
作者:Anker 发布时间:[ 2016/12/28 10:33:10 ] 推荐标签:nginx 配置管理
使用ectdctl添加配置如下:
./etcdctl set /nginx/https/www/server/server_name test.com
./etcdctl set /nginx/https/www/server/ssl_certificate /home/waf/build/openresty/nginx/cert/client/client.crt
./etcdctl set /nginx/https/www/server/ssl_certificate_key /home/waf/build/openresty/nginx/cert/client/client.key;
/etcdctl set /nginx/https/www/upstream/server1 192.168.1.2:443
./etcdctl set /nginx/https/www/upstream/server2 192.168.4.2:443
confd的执行结果如下所示:
生成位置文件如下所示:
upstream www_test.com {
server 192.168.1.2:443;
server 192.168.4.2:443;
}
server {
server_name test.com:443;
ssl on
ssl_certificate /home/waf/build/openresty/nginx/cert/client/client.crt;
ssl_certificate_key /home/waf/build/openresty/nginx/cert/client/client.key;
location / {
proxy_pass http://www_test.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
}
}
与模板生成的保持一致。
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11