Skip to content

Instantly share code, notes, and snippets.

@miah
Created September 12, 2012 21:26
Show Gist options
  • Select an option

  • Save miah/3710049 to your computer and use it in GitHub Desktop.

Select an option

Save miah/3710049 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'erubis'
input = File.read('./nginx.conf.erb')
eruby = Erubis::Eruby.new(input)
context = {
:listen_port => 80,
:chef_env => 'prod',
:public_domain => 'example.com',
:fqdn => 'derp.example.com',
:log_dir => '/var/log',
:docroot => '/var/www',
:https => false,
:cert_file => '/etc/ssl/cert.pem',
:cert_key => '/etc/ssl/cert.key',
:cgi => true,
:php => true,
:htpasswd_file => '/etc/httpd/auth.file'
}
puts eruby.evaluate(context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment