Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 964 Bytes

README.md

File metadata and controls

61 lines (45 loc) · 964 Bytes

nginx-conf.rb

Gem Version Build Status License

nginx.conf generator in Ruby

Installation

$ gem install nginx-conf

Usage

Code:

require 'nginx-conf'

c = nginx_conf do
  user :www

  http do
    server do
      listen 80
      server_name 'foo.com'
    end

    server do
      listen 443, :ssl
      server_name 'bar.com'
    end
  end
end

puts c

Output:

user www;
http {
    server {
        listen 80;
        server_name foo.com;
    }
    server {
        listen 443 ssl;
        server_name bar.com;
    }
}

For more complex example, see examples directory.

License

The Unlicense