???etcd+confd????nginx????
?????Anker ???????[ 2016/12/28 10:33:10 ] ????????nginx ???ù???
????1?????
???????????????nginx????????????????????nginx?????á??????????????????????????????http??httpsЭ???????????????????????????????????nginx??server???????nginx.conf????????????include?????е?server???ü???????????????????????ζ??????nginx?????????????????????????????????????????£??????????????????xml??????protobuf??xml?????????protobuf????????????????????protobuf????xml????????????????????ж??????????md5??????仯???С????????????????nginx?????????????????????á????????nginx??????????????void**** conf ??????????????????????????????????nginx???????????????????????????????????????????????о???????????????????????????????
upstream www_test {
server 196.75.121.112:443; ??????????
}
server {
listen 443 ssl; ??????????
server_name www.test.com; (???????)
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;;
ssl_certificate /home/build/openresty/nginx/cert/dealssl/www.bestenover.com.crt; (???????)
location / {
proxy_pass https://www_test; (???????)
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;
}
}
????2???????
????????nginx?????ò???????nginx??????????key value?????????????????????????????????????????????????????????????????????????key value??????????????redis??leveldb?????????etcd???key-value?????????????????????????????raftЭ?鱣????????????????????????????????????confd??etcd??????????nginx??????????????
???????etcd?????nginx?????????????£?
??????????webui?????ú???????nginx????????????????????????????
????3??????????
????WEBUI???API??????д??mysql??etcd??confd?????etcd??key?/nginx/?????????仯??confd??????????????á?confd????????·???/etc/confd/??????conf.d??template????????????????????????????塣
????nginx???????????????? ?? test.conf.toml
[template]
src = "test.conf.tmpl"
dest = "/tmp/test.conf"
keys = [
"/nginx"??
]
check_cmd = "/usr/sbin/nginx -t -c {{.src}}"
reload_cmd = "/usr/sbin/service nginx reload"
????nginx???????????????? ??test.conf.tmpl
upstream www_{{getv "/nginx/https/www/server/server_name"}} {
{{range getvs "/nginx/https/www/upstream/*"}}server {{.}};{{end}}
}
server {
server_name {{getv "/nginx/https/www/server/server_name"}}:443;
ssl on
ssl_certificate {{getv "/nginx/https/www/server/ssl_certificate"}};
ssl_certificate_key {{getv "/nginx/https/www/server/ssl_certificate_key"}};
location / {
proxy_pass http://www_{{getv "/nginx/https/www/server/server_name"}};
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;
}
}
????????confd????? ./confd -watch -backend etcd -node http://127.0.0.1:2379
??????
???·???
??????????????????
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