Commit 8ffe23e2267f7e35cee0e8468e9a07d765552eab
Committed by
Rafael Manzo
1 parent
ba370b18
Exists in
mezuro_cookbook
Adding nginx config file for prezento service
And removing manual installation of colab-mezuro-plugin
Showing
2 changed files
with
45 additions
and
19 deletions
Show diff stats
cookbooks/mezuro/recipes/prezento.rb
@@ -11,6 +11,10 @@ service 'prezento.target' do | @@ -11,6 +11,10 @@ service 'prezento.target' do | ||
11 | action [:enable, :start] | 11 | action [:enable, :start] |
12 | end | 12 | end |
13 | 13 | ||
14 | +service 'nginx' do | ||
15 | + action [:enable, :start] | ||
16 | +end | ||
17 | + | ||
14 | template '/etc/mezuro/prezento/database.yml' do | 18 | template '/etc/mezuro/prezento/database.yml' do |
15 | source 'prezento/database.yml.erb' | 19 | source 'prezento/database.yml.erb' |
16 | owner 'prezento' | 20 | owner 'prezento' |
@@ -42,24 +46,11 @@ template PREZENTO_DIR + '/config/kalibro.yml' do | @@ -42,24 +46,11 @@ template PREZENTO_DIR + '/config/kalibro.yml' do | ||
42 | notifies :restart, 'service[prezento.target]' | 46 | notifies :restart, 'service[prezento.target]' |
43 | end | 47 | end |
44 | 48 | ||
45 | -############################################################################# | ||
46 | -# The next lines install the mezuro plugin for colab intergration # | ||
47 | -# This shold be removed when the plugin were install thought pkg colab-deps # | ||
48 | -############################################################################# | ||
49 | - | ||
50 | -service 'colab' do | ||
51 | - action [:enable, :start] | ||
52 | -end | ||
53 | - | ||
54 | -git '/home/vagrant/colab-mezuro-plugin' do | ||
55 | - repository 'https://github.com/colab/colab-mezuro-plugin.git' | ||
56 | - revision 'master' | ||
57 | -end | ||
58 | - | ||
59 | -execute 'pip:install:plugin' do | ||
60 | - command '/usr/lib/colab/bin/pip install .' | ||
61 | - cwd '/home/vagrant/colab-mezuro-plugin' | ||
62 | - user 'root' | ||
63 | - notifies :restart, 'service[colab]' | 49 | +template '/etc/nginx/conf.d/prezento.conf' do |
50 | + source 'prezento/nginx.conf.erb' | ||
51 | + owner 'root' | ||
52 | + group 'root' | ||
53 | + mode 0644 | ||
54 | + notifies :restart, 'service[nginx]' | ||
64 | end | 55 | end |
65 | 56 |
@@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
1 | +# vim: ft=nginx | ||
2 | + | ||
3 | +upstream mezuro { | ||
4 | + server 127.0.0.1:8081 fail_timeout=10s; | ||
5 | +} | ||
6 | + | ||
7 | +server { | ||
8 | + listen *:84; | ||
9 | + | ||
10 | + server_name <%= node['peers']['mezuro'] %>; | ||
11 | + | ||
12 | + access_log /var/log/nginx/mezuro.access.log; | ||
13 | + error_log /var/log/nginx/mezuro.error.log; | ||
14 | + underscores_in_headers on; | ||
15 | + client_max_body_size 150m; | ||
16 | + | ||
17 | + | ||
18 | + #root /usr/share/mezuro/prezento/public/; | ||
19 | + | ||
20 | + location /mezuro/ { | ||
21 | + alias /usr/share/mezuro/prezento/public/; | ||
22 | + try_files $uri @mezuro-app; | ||
23 | + } | ||
24 | + | ||
25 | + location @mezuro-app { | ||
26 | + proxy_pass http://mezuro; | ||
27 | + proxy_read_timeout 90; | ||
28 | + proxy_connect_timeout 90; | ||
29 | + proxy_redirect off; | ||
30 | + proxy_set_header Host $host; | ||
31 | + proxy_set_header X-Real-IP $remote_addr; | ||
32 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
33 | + } | ||
34 | +} | ||
35 | + |