Skip to content

Setting up nginx cache, not getting the expected result. #424

@gl00ten

Description

@gl00ten

I have this code:

# class: test::nginx
class test::nginx {
  # create directories here if needed
  # $dirs = ['/dir1', '/dir1/dir2, '/dir3',]
  #
  #  file { $dirs:
  #    ensure => directory,
  #    mode   => '0755',
  #  }

  class { '::nginx':
    proxy_cache_path => '/data/nginx/cache keys_zone=one:10m',
  }

  # maybe this resource is not necessary
  nginx::resource::vhost { 'test2.local':
    ensure   => present,
    www_root => '/var/www',
  }

  nginx::resource::location { 'cached':
    ensure      => present,
    www_root    => 'var/www',
    vhost       => 'test2.local',
    location    => '/cached',
    # 'one' comes from proxy path, most likely
    proxy_cache => 'one',
  }
}

But in the generated sites-enabled/test2.local.conf there is no:

    server {
        proxy_cache one;

as decribed here : http://nginx.com/resources/admin-guide/caching/

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-feedbackFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions