nginx - 覆盖 Nginx Recipe default_enabled_site

标签 nginx chef-infra

我在尝试禁用 Nginx 中的 default_enabled_site 时遇到了一些麻烦。

# My Cookbook
/cookbooks/my-server-book
- /recipes/
- /attributes/
metadata.rb

# Opscode Nginx
/cookbooks/nginx

我已覆盖['nginx']['enable_default_site'] = false到我的/cookbooks/my-server-book/attributes/default.rb文件中,但看起来 Nginx Recipe 覆盖了我的更改

Recipe: nginx::commons_conf

* template[nginx.conf] action create (up to date)
* template[/etc/nginx/sites-available/default] action create (up to date)
* execute[nxdissite default] action run (skipped due to only_if)

任何见解我都会非常感激。

我在 node.json 文件中尝试了以下操作,但没有成功:

{
  "nginx": {
    "default_site_enabled": false
  },
  "run_list": ["recipe[main]"]
}

最佳答案

execute[nxdissite default] - 这告诉您默认站点已被禁用(配置文件将始终被创建,但不会符号链接(symbolic link)到当前启用的配置目录),因此您的覆盖似乎有效.

关于nginx - 覆盖 Nginx Recipe default_enabled_site,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15923307/

相关文章:

http - nginx 日志 http 状态 什么是 404 187

node.js - 在反向代理模式下使用 NGINX 压缩资源

node.js - 如何从 digital ocean 负载均衡器 -> Nginx -> Node 脚本获取真实IP地址?

php - 我们如何在没有数据库的情况下设置 cakephp 3.x?

tomcat - chef-jira Recipe - Vagrant 问题

ruby - Chef solo 不在redhat linux中运行

chef-infra - Chef-错误:RuntimeError:请设置EDITOR环境变量

nginx - Nginx 后面的 ASP.NET Core 中的 SignalR

chef-infra - 运行 Chef 客户端抛出 404 "Object Not Found"(Net::HTTPServerException)

rabbitmq - 将 sensu-client 连接到服务器时,AMQP 连接的 bad_header