首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Haproxy多行配置

Haproxy多行配置
EN

Stack Overflow用户
提问于 2018-12-10 20:48:45
回答 1查看 5.4K关注 0票数 9

是否可以将配置参数(在haproxy.cfg中)拆分为多行?

示例

当前

代码语言:javascript
复制
frontend
     https-in bind :443 ssl strict-sni crt </path/to/cert1.pem> crt </path/to/cert2.pem> crt </path/to/cert3.pem> ...

理想化

代码语言:javascript
复制
frontend 
    https-in bind :443 ssl strict-sni
        crt </path/to/cert1.pem>
        crt </path/to/cert2.pem>
        crt </path/to/cert3.pem>
        ...

尝试理想时的错误

代码语言:javascript
复制
$ /usr/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg
[ALERT] 343/210133 (25646) : parsing [/etc/haproxy/haproxy.cfg:45] : unknown keyword 'crt' in 'frontend' section
[ALERT] 343/210133 (25646) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 343/210133 (25646) : Fatal errors found in configuration.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-11 04:53:42

不能在haproxy.cfg中执行多行语法。

查看文件格式文档:https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#2.1

更新:

感谢Venky的评论,我看到也有使用crt-list的选项,这确实为多行pem文件引用提供了一个选项。https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.1-crt-list

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53713425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档