简体   繁体   中英

Unable to write to /etc/nginx with eb deploy (aws elastic beanstalk NodeJS)

I'm on NodeJS Elastic Beanstalk and I'm encountering a weird issue when deploying via eb deploy .

My .ebextensions folder has a file that should create a file on /etc/nginx/conf.d/

files:
  "/etc/nginx/conf.d/file_size_proxy.conf":
    mode: "000755"
    owner: root
    group: root
    content: |
        client_max_body_size 25M;

But it looks like it's not able to. I tried several things to test this:

  • tried writing it to /tmp directory and it's able to
  • tried to ssh and manually create the file. It can. So my account shouldn't have problems
  • tried creating a bash file that will just migrate the file from /tmp to /etc/nginx/conf.d directory. It's unable to migrate the file if run via the .ebextensions route. But run the bash file via ssh, it will.

I've hit the wall. Any idea why this is happening, really appreciate it.

*Somebody posted the RIGHT answer to this question, but he somehow deleted it, or somebody else did. Not sure if it was an illegal answer? :D I'm waiting for him to repost it, but I guess he deleted it intentionally. *

To solve this issue. instead of placing the nginx file modification under .ebextensions , place it under .platform . So, in this case, have the file under:

.platform/nginx/conf.d/proxy.conf

with content...

client_max_body_size 25M;

That's it. It worked, This, btw. is not documented elsewhere -- or at least I didn't see it anywhere. I'm not sure why. The original poster mentioned something like a new AWS api release or something. Maybe this is new.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM