Amazon Elastic Beanstalk ebextension
Asked Answered
L

1

0

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
Langbehn answered 3/5, 2018 at 10:59 Comment(0)
E
2

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.

Elsewhere answered 9/5, 2018 at 17:27 Comment(2)
It should be 01-custom-nginx-proxy.conf or 01-custom-nginx-proxy.config ?Langbehn
It should be .config - sorry for the typo.Elsewhere

© 2022 - 2024 — McMap. All rights reserved.