awsdocs / elastic-beanstalk-samples

This repository contains code and configuration samples (e.g. .ebextensions) for AWS Elastic Beanstalk.
Apache License 2.0
1.22k stars 889 forks source link

AWS ElasticBeanstalk Amazon Linux 2 .platform folder not copying NGINX conf #144

Closed tahacanatak closed 3 years ago

tahacanatak commented 3 years ago

I am publishing my application on Elasticbeanstalk using Amazon Linux 2 and am having trouble typing command over the default nginx.conf file. The nginx configurations in the .platform folder in the root of my application are not working. The process is as follows.

.platform/
         nginx/
              conf.d/
                    timeout.conf
         00_myconf.config

Content of File 1 - timeout.conf (Inside .platform/nginx/conf.d/ folder)


keepalive_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s; 
proxy_read_timeout 600s; 
fastcgi_send_timeout 600s; 
fastcgi_read_timeout 600s;

Content of File 2 - 00_myconf.config (Inside .platform/ folder)


container_commands:
   01_reload_nginx:
     command: "service nginx reload"
mtoftum commented 3 years ago

I've run into a similar issue. Which looked as if modifying the nginx config led to nginx never getting reloaded and thus missing the proxy config leading to all requests going 404. Forcing an nginx reload later did seem to do the trick.

Harsha-changejar commented 3 years ago

Is there any resolution yet for this issue?

gastonyelmini commented 3 years ago

Is there any resolution yet for this issue?

same issue

Harsha-changejar commented 3 years ago

I got it working, while i SSHed into the beanstalk instance, found that beanstalk was using folderstructure .platform/ nginx/ conf.d/ elasticbeanstalk/ timeout.conf

                   Use the above folder structure and it shud work
EdgeCaseBerg commented 3 years ago

I tried the folder structure Harsha-changejar said worked for him and it didn't work for me. I'm running on Java 8 running on 64bit Amazon Linux/2.11.2 and have no idea why none of the .platform files seem to get picked up at all when I deploy to beanstalk. My file is just trying to extend the nginx configuration by including

client_max_body_size 600M;
proxy_connect_timeout 600;
proxy_send_timeout    600;
proxy_read_timeout    600;
send_timeout          600;

at .platform/nginx/conf.d/uploads.conf inside my source bundle zip that I deploy

Harsha-changejar commented 3 years ago

I tried the folder structure Harsha-changejar said worked for him and it didn't work for me. I'm running on Java 8 running on 64bit Amazon Linux/2.11.2 and have no idea why none of the .platform files seem to get picked up at all when I deploy to beanstalk. My file is just trying to extend the nginx configuration by including

client_max_body_size 600M;
proxy_connect_timeout 600;
proxy_send_timeout    600;
proxy_read_timeout    600;
send_timeout          600;

at .platform/nginx/conf.d/uploads.conf inside my source bundle zip that I deploy

PLease double check ur folder structure, it needs to be placed under .platform/nginx/conf.d/elasticbeanstalk/uploads.conf

tahacanatak commented 3 years ago

I tried the folder structure Harsha-changejar said worked for him and it didn't work for me. I'm running on Java 8 running on 64bit Amazon Linux/2.11.2 and have no idea why none of the .platform files seem to get picked up at all when I deploy to beanstalk. My file is just trying to extend the nginx configuration by including

client_max_body_size 600M;
proxy_connect_timeout 600;
proxy_send_timeout    600;
proxy_read_timeout    600;
send_timeout          600;

at .platform/nginx/conf.d/uploads.conf inside my source bundle zip that I deploy

PLease double check ur folder structure, it needs to be placed under .platform/nginx/conf.d/elasticbeanstalk/uploads.conf

this directory solved my problem thank you

MoinuddinOps commented 3 years ago

I am getting this error "Gateway Timeout The gateway did not receive a timely response from the upstream server or application." so how can I increase my max execution time out for apache?