Elastic Beanstalk | .Net with Docker containg custon nginx.conf
0
Current Setup: Elastic Beanstalk running Docker running on 64bit Amazon Linux 2/3.4.11.
I was trying to follow AWS Guidelines for overwrite nginx.conf file located in /etc/nginx/nginx.conf without any success. I have .NET 5 project containing the .platform/nginx/nginx.conf (also trying .ebextenstion). When I'm building my dockerfile and deploying to ECR, adding dockerrun.aws.json to pull the latest image its not taking my custom nginx.conf.
nginx.file:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid/var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include conf.d/*.conf;
map $http_upgrade $connection_upgrade {
default "upgrade";
}
server {
listen 80 default_server;
gzip on;
gzip_comp_level 4;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
access_log /var/log/nginx/access.log main;
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection$connection_upgrade;
proxy_set_header Upgrade$http_upgrade;
proxy_set_header Host$host;
proxy_set_header X-Real-IP$remote_addr;
proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for;
}
# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/*.conf;
}
}
I would like to know how can I fix it and replace the nginx default file.
Thanks!
asked 3 months ago78 views
1 Answers
1
Found the Solution. I working with dockerrun.aws.json v3 so I just created a zip file that contain the dockerrun.aws.json + folder ./platform/nginx and now its working!
answered 3 months ago
Relevant questions
How long can we use 'Multi-container Docker running on 64bit Amazon Linux' on Beanstalk?
asked a month agoRun (custom) Keycloak 17 Docker Image on AWS Beanstalk
asked 4 months agoBeanstalk node.js amazon linux 2 running on nginx 1.20.0 which has critical vulnerability CVE-2021-23017
asked 4 months agoPOST request on .NET Elastic Beanstalk instance takes longer than GET on similar operation
asked 3 months agoDocker: Elastic Beanstalk with EFS filesystem
asked 2 months agoCan't run 'rails console' on Elastic Beanstalk Amazon Linux 2
Accepted Answerasked 3 months agoElastic Beanstalk | .Net with Docker containg custon nginx.conf
asked 3 months agoMigrating Multi-container Docker running on Amazon Linux to ECS on Amazon Linux 2
asked 3 months agoCustomizing the Docker Run Command on Elastic Beanstalk
asked 3 months agoNo solution stack named 64bit Amazon Linux 2018.03 v2.10.1 running Go
asked 3 years ago
You could mark your answer as 'accepted' to indicate this question has a solution.