Skip to content

Instantly share code, notes, and snippets.

@dougmarcey
Created November 4, 2013 23:22
Show Gist options
  • Save dougmarcey/7311087 to your computer and use it in GitHub Desktop.
Save dougmarcey/7311087 to your computer and use it in GitHub Desktop.
class hbs::nginxnode (
$hostname = $fqdn
){
nginx::resource::upstream { 'hbsnode':
ensure => present,
members => [
'localhost:4000'
],
require => Nginx::Resource::Vhost[$hostname]
}
nginx::resource::location { "api":
ensure => present,
location => "~ ^/api/",
proxy => "http://hbsnode",
vhost => $hostname,
location_cfg_append => {
rewrite => "^/api/(.+)?$ /$1 break;"
},
require => Nginx::Resource::Vhost[$hostname]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment