今天在配置nginx的时候出了一件很囧的事情,以前配置是这样的

/usr/local/nginx/conf/

  -nginx.conf

  -my.conf

然后在nginx.conf里加上 include my.conf

 

今天我发现conf下面还有个vhosts的文件夹,于是我就这样做

/usr/local/nginx/conf/

  -nginx.conf

  vhosts/

    -my.conf

然后在nginx.conf里写了include vhosts/my.conf

再加来运行

/usr/local/nginx/sbin/nginx -t

结果提示我虚拟域名配置重复了!

果断查询一下

find /usr/local/nginx/conf -name "*.conf" | xargs grep -n "my.domain"

结果没发现重复,我google了很长时间,最后灵光一闪!

cat /usr/local/nginx/conf/nginx.conf | grep vhosts

结果是

include vhosts/*.conf

太囧了!

相关文章:

  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-06-09
猜你喜欢
  • 2021-07-08
  • 2021-10-17
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案