Skip to content

Instantly share code, notes, and snippets.

@waako
Last active December 25, 2015 12:09
Show Gist options
  • Save waako/6974689 to your computer and use it in GitHub Desktop.
Save waako/6974689 to your computer and use it in GitHub Desktop.
nginx puppet alias directory
nginx::resource::vhost { 'test.dev':
ensure => present,
server_name => [
'test.dev' ],
listen_port => 80,
index_files => [
'index.html',
'index.htm',
'index.php'
],
www_root => '/var/www/test.dev/www',
try_files => ['$uri', '$uri/', '/index.php?$args'],
}
nginx::resource::location { 'test.dev-php':
ensure => 'present',
vhost => 'test.dev',
location => '~ \.php$',
proxy => undef,
try_files => ['$uri', '$uri/', '/index.php?$args'],
www_root => '/var/www/test.uk.dev/www',
location_cfg_append => {
'fastcgi_split_path_info' => '^(.+\.php)(/.+)$',
'fastcgi_param' => 'PATH_INFO $fastcgi_path_info',
'fastcgi_param ' => $path_translated,
'fastcgi_param ' => $script_filename,
'fastcgi_pass' => '127.0.0.1:9000',
'fastcgi_index' => 'index.php',
'include' => 'fastcgi_params'
},
notify => Class['nginx::service'],
}
nginx::resource::location { 'test.dev-alias' :
ensure => present,
location => '/assets',
location_alias => '/var/www//assets',
vhost => 'test.dev',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment