【问题标题】:Amazon Elastic Beanstalk ebextensionAmazon Elastic Beanstalk ebextension
【发布时间】:2018-10-13 16:07:30
【问题描述】:

我想在 Amazon Elastic Beanstalk 上使用 ebextension 配置 nginx 配置,

conf的内容如下:

files:
    "/etc/nginx/conf.d/custom-nginx-proxy.conf" :
        mode: "000755"
        owner: "root"
        group: "root"
        content: |
            client_max_body_size 60M;

contatiner_commands:
    reload_nginx:
        command: "sudo service nginx reload"

但总是得到关于内容的错误,

nginx: [emerg] 未知指令“files:”在 /var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf:7

我把这个文件放在

ROOT.war 
   |- ROOT/
        |- .ebextensions
               |- nginx
                    |- conf.d
                         |- custom-nginx-proxy.conf
        |- Others content

【问题讨论】:

    标签: amazon-web-services nginx amazon-elastic-beanstalk ebextensions


    【解决方案1】:

    您的扩展程序应放置在 .ebextensions/01-custom-nginx-proxy.config 中。此外,第二个块应该以container_commands: 开头,而不是contatiner_commands:,并且您不需要sudo,因为部署已经以root 身份运行。如果这没有帮助,请尝试在每个缩进级别使用两个空格。 EB 扩展是用 YAML 编写的,对空格非常敏感。

    如果您仍然卡住,请发布 /var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf 的内容 - 部署后创建的文件。

    【讨论】:

    • 应该是 01-custom-nginx-proxy.conf 还是 01-custom-nginx-proxy.config ?
    • 应该是 .config - 抱歉打错了。
    猜你喜欢
    • 2022-10-04
    • 2016-02-22
    • 2019-01-01
    • 2014-12-15
    • 1970-01-01
    • 2018-03-24
    • 2013-12-05
    • 2013-06-12
    • 2015-02-23
    相关资源
    最近更新 更多