簡體   English   中英

Amazon Elastic Beanstalk ebextension

[英]Amazon Elastic Beanstalk ebextension

我想在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] /var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf:7中的未知指令“文件:”

我把這個文件放在

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

您的擴展名應放在.ebextensions / 01-custom-nginx-proxy.config中 另外,第二個塊應該以container_commands: contatiner_commands: ,而不是contatiner_commands: ,並且您不需要sudo因為部署已經以root身份運行。 如果這樣做沒有幫助,請嘗試在每個縮進級別使用兩個空格。 EB擴展使用YAML編寫,它對空格非常敏感。

如果仍然遇到問題,請發布/var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf的內容-部署后創建的文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM