AWS Beanstalk Using Linux 2023 Doesn't seem to support nginx ./platform/nginx/conf.d/myconfig.conf file

0

I'm trying to override the client_header_timeout nginx config by adding the config

client_header_timeout 300;

to the file: ./platform/nginx/conf.d/myconfig.conf

My EC2 instance has the following config:

VERSION_ID="2023" PLATFORM_ID="platform:al2023" PRETTY_NAME="Amazon Linux 2023.6.20250317" openjdk version "21.0.6" 2025-01-21 LTS

AWS beanstalk seems to completely ignore this file, despite it picking up other startup commands within my ./ebextensions directory

asked 12 days ago45 views
1 Answer
0

It appears that you're encountering an issue with AWS Elastic Beanstalk not recognizing your custom Nginx configuration on Amazon Linux 2023. This is likely due to a change in how Elastic Beanstalk handles Nginx configurations in newer platform versions.

For Amazon Linux 2023, the correct approach to customize Nginx configuration is slightly different from what you're currently trying. Instead of placing your configuration in .platform/nginx/conf.d/myconfig.config, you should use the following structure:

  1. Create a directory .platform/nginx/conf.d/ in your application source bundle.
  2. Place your custom Nginx configuration file (e.g., myconfig.conf) inside this directory.

Make sure your configuration file has a .conf extension, not .config.

Your directory structure should look like this:

~/my-app/
|-- .platform/
|   `-- nginx/
|       `-- conf.d/
|           `-- myconfig.conf

In your myconfig.conf file, you can add your custom Nginx settings:

client_header_timeout 300;

Elastic Beanstalk will automatically include .conf files from this directory in its Nginx configuration.

If you want to completely override the default Nginx configuration, you can create a file at .platform/nginx/nginx.conf with your full custom configuration. However, if you do this, make sure to include the following line in your custom nginx.conf to pull in Elastic Beanstalk's configurations for enhanced health reporting, monitoring, and other essential features:

include conf.d/elasticbeanstalk/*.conf;

Remember that after making these changes, you'll need to redeploy your application for the new configuration to take effect. If you're still experiencing issues after implementing these changes, you may want to check the Elastic Beanstalk logs for any error messages related to Nginx configuration.
Sources
Application example with extensions - AWS Elastic Beanstalk
Configuring the proxy server - AWS Elastic Beanstalk

profile picture
answered 12 days ago
  • This doesn't seem to work on Amazon Linux 2023.6.20250317

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions