Giter Club home page Giter Club logo

Comments (3)

axl89 avatar axl89 commented on August 16, 2024

My bad, I've just realized that I did not include the template parameter. Maybe it'd be good to set it to default-site.erb as default? :)

To better clarify it:

This works:

 nginx_site 'test_site' do
   template 'default-site.erb'
   variables(
     'port': 80,
     'server_name': 'test_site',
     'default_root': '/var/www/nginx-default',
     'nginx_log_dir': '/var/log/nginx'
   )
   action :create
   owner 'root'
   mode '777'
   notifies :reload, 'nginx_service[nginx]', :delayed
 end

This doesn't:

 nginx_site 'test_site' do
   variables(
     'port': 80,
     'server_name': 'test_site',
     'default_root': '/var/www/nginx-default',
     'nginx_log_dir': '/var/log/nginx'
   )
   action :create
   owner 'root'
   mode '777'
   notifies :reload, 'nginx_service[nginx]', :delayed
 end

Anyway, feel free to close this issue.

from nginx.

bmhughes avatar bmhughes commented on August 16, 2024

Ok just had a quite look and it seems that the docs are wrong, I'll get an update in. You'll have to reference the default site-template in the mean time to get the correct hash keys.

The expectation was that people would override the template used for their use case so the default template is very loose, looks like that example resource was carried over from < v11 and was missed.

The default template is centered around nested hashes for upstream, server and map so configuration entries need to be under those.

from nginx.

bmhughes avatar bmhughes commented on August 16, 2024

My bad, I've just realized that I did not include the template parameter. Maybe it'd be good to set it to default-site.erb as default? :)

Anyway, feel free to close this issue.

The template property does default to default-site.erb.

from nginx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.