Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken nginx staged config check #322

Open
Xarno opened this issue Mar 20, 2024 · 0 comments
Open

Broken nginx staged config check #322

Xarno opened this issue Mar 20, 2024 · 0 comments
Labels

Comments

@Xarno
Copy link

Xarno commented Mar 20, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or "me too" comments. They generate extra noise for issue followers and do not help prioritize the request.

Tell us about your request
I found out that the current verification check for the new nginx config is broken.

Is this request specific to an Elastic Beanstalk platform?
Tested with Tomcat 9 with Corretto 11 running on 64bit Amazon Linux 2023/5.1.4
Most likely affects all platforms with proxy servers.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

# this is what is executed:
/bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf
nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
Enter PEM pass phrase:
Enter PEM pass phrase:
nginx: [emerg] cannot load certificate key "/etc/pki/CA/intermediate/private/wallstreet.aws.corussoft.de.key.pem": PEM_read_bio_PrivateKey() failed (SSL: error:0480006D:PEM routines::problems getting password error:07880109:common libcrypto routines::interrupted or cancelled error:07880109:common libcrypto routines::interrupted or cancelled error:1C80009F:Provider routines::unable to get passphrase error:0480006D:PEM routines::problems getting password error:07880109:common libcrypto routines::interrupted or cancelled error:04800068:PEM routines::bad password read)

# this is what should have been executed
/bin/sh -c "/usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf"
nginx: the configuration file /var/proxy/staging/nginx/nginx.conf syntax is ok
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test is successful

You have forgotten to qoute the command given to /bin/sh and thus execute the config check against the current config, not against the staging config.
It errors out in my case, because i have a password protected private key in the config which was replaced by another part of the .ebextension files.

Are you currently working around this issue?
Looking for a workaround.

Additional context
The error is logged in eb-engine.log

@Xarno Xarno added the Proposed label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant