- Newest
- Most votes
- Most comments
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:
- Create a directory
.platform/nginx/conf.d/
in your application source bundle. - 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
Relevant content
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 10 months ago
This doesn't seem to work on Amazon Linux 2023.6.20250317