今天配置Server_name时,希望禁用一些域名,应为这些域名我想让通过另外一个Server配置

 server_name "~^((\w*[^w]{1}\w*)|w{1,2})\.hello\.com$";

就是不允许www.hello.com访问这个配置

但是一直提示Starting nginx: nginx: [emerg] directive "server_name" is not terminated by ";"

发现原来是{}引起的错误,只需要给正则添加一个双引号就可以了。

 

另外,在centos数据备份时,写了sh脚本,也一样,如果没有双引号也会出现这个问题

tar zcvPf "/bak/boot.`date +%Y%m%d%H%M`.tar.gz" "/boot/";

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2021-01-01
  • 2022-12-23
  • 2021-11-01
  • 2021-04-18
  • 2021-05-31
  • 2021-11-20
猜你喜欢
  • 2022-01-24
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-11-20
  • 2022-01-26
相关资源
相似解决方案