nginx-config 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nginx-config.gemspec
4
+ gemspec
5
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 max-konin
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Nginx::Config
2
+
3
+ Gem implement generator for generate config file for unicorn server instance for nginx
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'nginx-config'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install nginx-config
18
+
19
+ ## Usage
20
+
21
+
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/gem_tasks"
2
+ require 'yard'
3
+ YARD::Rake::YardocTask.new
@@ -0,0 +1,32 @@
1
+ class NginxUnicornVhostGenerator < Rails::Generators::Base
2
+ def create_instance server_name, domain
3
+ create_file "config/nginx_unicorn_instance",
4
+ "
5
+ upstream #{server_name}_server {
6
+ server unix:/var/www/#{server_name}/shared/unicorn.sock fail_timeout=0;
7
+ }
8
+
9
+ server {
10
+ listen 80 default deferred;
11
+
12
+ client_max_body_size 1G;
13
+ server_name #{domain};
14
+ keepalive_timeout 5;
15
+ root /var/www/#{server_name}/current/public;
16
+ try_files $uri/index.html $uri.html $uri @myapp;
17
+
18
+ location @myapp {
19
+ proxy_pass http://#{server_name}_server;
20
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
21
+ proxy_set_header Host $http_host;
22
+ proxy_redirect off;
23
+ }
24
+
25
+ error_page 500 502 503 504 /500.html;
26
+ location = /500.html {
27
+ root /var/www/#{server_name}/current/public;
28
+ }
29
+ }
30
+ "
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ module Nginx
2
+ module Config
3
+ VERSION = "0.8.1"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "nginx/config/version"
2
+
3
+ module Nginx
4
+ module Config
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'nginx/config/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "nginx-config"
8
+ spec.version = Nginx::Config::VERSION
9
+ spec.authors = ["max-konin"]
10
+ spec.email = ["mk@kernel-corp.com"]
11
+ spec.description = %q{Generate unicorn vhost for nginx}
12
+ spec.summary = %q{Generate unicorn vhost for nginx}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "yard", "~> 0.7.5"
24
+ spec.add_development_dependency "rails", ">= 3.2.0"
25
+
26
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nginx-config
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - max-konin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-09-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: &83234080 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *83234080
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &83233550 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *83233550
36
+ - !ruby/object:Gem::Dependency
37
+ name: yard
38
+ requirement: &83232830 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 0.7.5
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *83232830
47
+ - !ruby/object:Gem::Dependency
48
+ name: rails
49
+ requirement: &83232000 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *83232000
58
+ description: Generate unicorn vhost for nginx
59
+ email:
60
+ - mk@kernel-corp.com
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - .gitignore
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - lib/generators/nginx_unicorn_vhost_generator.rb
71
+ - lib/nginx/config.rb
72
+ - lib/nginx/config/version.rb
73
+ - nginx-config.gemspec
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 1.8.11
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: Generate unicorn vhost for nginx
99
+ test_files: []
100
+ has_rdoc: