Amazon Elastic Beanstalk ebextension

折月煮酒 提交于 2021-01-29 10:52:19

问题


I want to config the nginx config with the ebextension at Amazon Elastic Beanstalk,

The content of the conf as below:

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"

but always got the error about the content,

nginx: [emerg] unknown directive "files:" in /var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf:7

I put this file at

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

回答1:


Your extension should be placed at .ebextensions/01-custom-nginx-proxy.config. Also, the second block should start with container_commands:, not contatiner_commands:, and you don't need sudo as the deployment will already be running as root. If that doesn't help, try using two spaces per indent level. EB extensions are written in YAML, which is very sensitive to whitespace.

If you're still stuck, please post the contents of /var/elasticbeanstalk/staging/nginx/conf.d/custom-nginx-proxy.conf - the file that gets created after your deployment.



来源:https://stackoverflow.com/questions/50153420/amazon-elastic-beanstalk-ebextension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!