Skip to content

raviqqe/nginx-conf.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

nginx.conf generator in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages