vagrant-reverse-proxy 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58327c38d18a0e56fe6daaf3614ad13b748aee25
|
4
|
+
data.tar.gz: ab5b2297ac9c441bfe7f25c8efa6a3efd8dff978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2edcff7ab0cd85ee985c67aacbf3ce5f62079cb190c15761ca2ccfcf9491fff712a2a5a72a34ce89e3247e31413ed5189b241d566d12d34890a8d50619db9e1
|
7
|
+
data.tar.gz: 7207d37dfa085633b7a528cd5b6eb9d0a7b6df2af8ba78f082f8333a452ec9488a46703246f98cef72024d57dddabbe2e79d55565a503c9053f943e23d70ee7e
|
data/README.md
CHANGED
@@ -78,6 +78,12 @@ If you want to change the location of the managed nginx configuration file, set
|
|
78
78
|
|
79
79
|
config.reverse_proxy.nginx_config_file = '/usr/local/etc/nginx/vagrant-proxy-config'
|
80
80
|
|
81
|
+
### Specifying the NGINX reload command
|
82
|
+
|
83
|
+
After the NGINX configuration file is generated, a reload command is executed so that the changes take effect. By default the command executed is `sudo nginx -s reload`. If you need to change this, set the `config.reverse_proxy.nginx_reload_command` option to the command to be executed:
|
84
|
+
|
85
|
+
config.reverse_proxy.nginx_reload_command = 'sudo service nginx reload'
|
86
|
+
|
81
87
|
## Adding proxy support to your application
|
82
88
|
|
83
89
|
This plugin will instruct NGINX to pass the following headers to your
|
@@ -66,9 +66,12 @@ module VagrantPlugins
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
# Finally, copy tmp config to actual config
|
69
|
+
# Finally, copy tmp config to actual config
|
70
70
|
Kernel.system('sudo', 'cp', tmp_file.to_s, nginx_config_file)
|
71
|
-
|
71
|
+
|
72
|
+
# And reload nginx
|
73
|
+
nginx_reload_command = env[:machine].config.reverse_proxy.nginx_reload_command || 'sudo nginx -s reload'
|
74
|
+
Kernel.system(nginx_reload_command)
|
72
75
|
end
|
73
76
|
|
74
77
|
def server_block(machine)
|
@@ -2,13 +2,14 @@ module VagrantPlugins
|
|
2
2
|
module ReverseProxy
|
3
3
|
class Plugin
|
4
4
|
class Config < Vagrant.plugin(2, :config)
|
5
|
-
attr_accessor :enabled, :vhosts, :nginx_config_file
|
5
|
+
attr_accessor :enabled, :vhosts, :nginx_config_file, :nginx_reload_command
|
6
6
|
alias_method :enabled?, :enabled
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@enabled = UNSET_VALUE
|
10
10
|
@vhosts = UNSET_VALUE
|
11
11
|
@nginx_config_file = UNSET_VALUE
|
12
|
+
@nginx_reload_command = UNSET_VALUE
|
12
13
|
end
|
13
14
|
|
14
15
|
def finalize!
|
@@ -33,6 +34,9 @@ module VagrantPlugins
|
|
33
34
|
if @nginx_config_file == UNSET_VALUE
|
34
35
|
@nginx_config_file = nil
|
35
36
|
end
|
37
|
+
if @nginx_reload_command == UNSET_VALUE
|
38
|
+
@nginx_reload_command = nil
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
def validate(machine)
|
@@ -69,6 +73,10 @@ module VagrantPlugins
|
|
69
73
|
errors << 'nginx_config_file must be a string'
|
70
74
|
end
|
71
75
|
|
76
|
+
unless @nginx_reload_command.instance_of?(String) || @nginx_reload_command == nil || @nginx_reload_command == UNSET_VALUE
|
77
|
+
errors << 'nginx_reload_command must be a string'
|
78
|
+
end
|
79
|
+
|
72
80
|
{ 'Reverse proxy configuration' => errors.compact }
|
73
81
|
end
|
74
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-reverse-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|