docker - Nginx 容器无法启动 - 在“启动工作进程”时挂起
问题描述
由于某种我无法理解的原因,我的 nginx 容器在尝试启动时开始失败。它只是在几个start worker process
日志条目后挂起,我在下面包含了输出:
Generating /apps/nginx/upstreams.conf...done.
Generating /apps/nginx/locations.conf...done.
Creating NGINX listener certificate...
Successfully generated /apps/nginx/resolver.conf: resolver 192.168.65.5;
Generating /apps/nginx/listen.conf...done.
Starting Nginx...
Generating /apps/nginx/upstreams.conf...done.
Generating /apps/nginx/locations.conf...done.
Creating NGINX listener certificate...
Successfully generated /apps/nginx/resolver.conf: resolver 192.168.65.5;
Generating /apps/nginx/listen.conf...done.
Starting Nginx...
Generating a RSA private key
....................................................+++++
.....................................................................................................+++++
writing new private key to '/apps/nginx/nginx-key.pem'
-----
Generating a RSA private key
........+++++
.................................................................+++++
writing new private key to '/apps/nginx/nginx-key.pem'
-----
2021/10/04 17:39:16 [notice] 1#1: using the "epoll" event method
2021/10/04 17:39:16 [notice] 1#1: nginx/1.20.1
2021/10/04 17:39:16 [notice] 1#1: built by gcc 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
2021/10/04 17:39:16 [notice] 1#1: OS: Linux 5.10.25-linuxkit
2021/10/04 17:39:16 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/10/04 17:39:16 [notice] 1#1: start worker processes
2021/10/04 17:39:16 [notice] 1#1: start worker process 20
2021/10/04 17:39:16 [notice] 1#1: start worker process 21
2021/10/04 17:39:16 [notice] 1#1: start worker process 22
2021/10/04 17:39:16 [notice] 1#1: start worker process 23
2021/10/04 17:39:16 [notice] 1#1: start worker process 24
2021/10/04 17:39:16 [notice] 1#1: start worker process 25
此外,根本没有错误日志/var/log/nginx/error.log
这没什么好说的,但我不确定还有哪些其他细节可能有助于分享。我只是想知道是否有人以前在 docker 容器内的 nginx 实例中看到过这样的错误消息?
解决方案
我有同样的问题。这对我有用:
docker-compose build --no-cache nginx
推荐阅读
- python - 无法在 df.plot 的 x 轴上绘制日期
- react-native - 关于 React-native 的 Global AwesomeAlert
- ruby-on-rails - Rails 在多态中使用状态机
- python - 在熊猫数据框中选择列
- sql-server - 名为“tds_cur”的游标不存在
- node.js - 服务器的活动句柄不断增加,然后停止服务器
- javascript - 骨架 css 直到页面完成加载
- recharts - Recharts - 如何为折线图和条形图提供两种不同的工具提示
- react-native - 如何在 react-native-svg 元素中实现填充属性
- django - 无法部署到 Heroku - 运行“$ python manage.py collectstatic --noinput”时出错