成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10

简介: 这篇文章详细介绍了Linux虚拟机磁盘空间不足时的扩容流程,从外部配置到具体扩容操作,再到验证扩容效果的步骤。同时,也探讨了Docker容器磁盘空间耗尽的问题,并提供了解决方案,包括删除无用镜像和容器,以及如何重新配置Docker的存储位置。文章还涵盖了一些意外情况的处理方法,比如误删容器后的恢复策略,并最终展示了使用Docker安装nginx并成功访问的详细过程。

文章目录

    • 错误信息
    • 解决方法
    • 成功解决

前言
再用nginx做反向代理的时候,修改配置后。重新启动失败。原因是配置文件中少了分号。

错误信息

查看nginx容器日志

关键部分

nginx: [emerg] unexpected “}” in /etc/nginx/conf.d/gulimall.conf:10

[root@localhost conf.d]# docker logs 316082aab88b 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
nginx: [emerg] unexpected "}" in /etc/nginx/conf.d/gulimall.conf:10
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
nginx: [emerg] unexpected "}" in /etc/nginx/conf.d/gulimall.conf:10

解决方法

在配置文件中修改

在这里插入图片描述

成功解决

再次运行nginx

在这里插入图片描述

相关文章
|
6月前
|
应用服务中间件 网络安全 nginx
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
1319 0
|
应用服务中间件 nginx
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
306 2
|
6月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
1658 0
|
6月前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
6月前
|
应用服务中间件 nginx
Nginx启动时提示nginx: [emerg] still could not bind()
Nginx启动时提示nginx: [emerg] still could not bind()
607 0
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
342 0
|
23天前
|
应用服务中间件 BI nginx
Nginx的location配置详解
【10月更文挑战第16天】Nginx的location配置详解
|
30天前
|
缓存 负载均衡 安全
Nginx常用基本配置总结:从入门到实战的全方位指南
Nginx常用基本配置总结:从入门到实战的全方位指南
247 0
|
1月前
|
应用服务中间件 Linux nginx
Jetson 环境安装(四):jetson nano配置ffmpeg和nginx(亲测)之编译错误汇总
这篇文章是关于在Jetson Nano上配置FFmpeg和Nginx时遇到的编译错误及其解决方案的汇总。
85 4
|
3天前
|
存储 负载均衡 中间件
Nginx反向代理配置详解,图文全面总结,建议收藏
Nginx 是大型架构必备中间件,也是大厂喜欢考察的内容,必知必会。本篇全面详解 Nginx 反向代理及配置,建议收藏。
Nginx反向代理配置详解,图文全面总结,建议收藏