bitnami/nginx-停止生成 RSA 密钥对

bitnami/nginx-停止生成 RSA 密钥对

请问有没有办法在启动时停止 bitnami/nginx 生成 RSA 密钥对(因为我在 nginx.conf 中没有使用 SSL)?

启动应用程序需要 25-30 秒 :(

谢谢

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! **

答案1

即使您没有在 nginx.conf 中配置 SSL,也必须存在(即使是空的)文件 /certs/server.crt...

图像起始脚本部分

答案2

根据他们的自述文件,您可以持久存储这些证书:

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

试试看。我发现了这个这里

相关内容