0

Please is there a way to stop bitnami/nginx to generate RSA key pair on start (since I am not using SSL in nginx.conf)?

It takes 25-30 seconds to start the app :(

Thanks

nginx 20:56:32.30
nginx 20:56:32.50 Welcome to the Bitnami nginx container
nginx 20:56:32.80 Subscribe to project updates by watching https://github.com/bitnami/containers
nginx 20:56:33.00 Submit issues and feature requests at https://github.com/bitnami/containers/issues
nginx 20:56:33.20
nginx 20:56:33.39 INFO ==> ** Starting NGINX setup **
nginx 20:56:34.70 INFO ==> Validating settings in NGINX_* env vars
nginx 20:56:35.30 WARN ==> The NGINX configuration file '/opt/bitnami/nginx/conf/nginx.conf' is not writable by current user. Configurations based on environment variables will not be applied.
Generating RSA private key, 4096 bit long modulus (2 primes)
.....................++++
.....................................................++++
e is 65537 (0x010001)
Signature ok
subject=CN = example.com
Getting Private key
nginx 20:57:00.90 INFO ==> No custom scripts in /docker-entrypoint-initdb.d
nginx 20:57:01.40 INFO ==> Initializing NGINX
realpath: /bitnami/nginx/conf/vhosts: No such file or directory
nginx 20:57:03.70 INFO ==> ** NGINX setup finished! **
tomas
  • 123
  • 3

2 Answers2

0

there must exist (even empty) file /certs/server.crt even if you do not have SSL configured in your nginx.conf...

section from image starting scrpit

tomas
  • 123
  • 3
0

Based on their README you can just store these certificates persistently:

docker run --name nginx \
  -v /path/to/my_server_block.conf:/opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:ro \
  -v /path/to/nginx-persistence/certs:/certs \
  bitnami/nginx:latest

Try it out. I've found this here.