capistrano-unformatt 1.9 → 1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/capistrano-unformatt.gemspec +1 -1
- data/lib/capistrano/unformatt/setup.rb +4 -0
- data/vendor/templates/nginx.conf.erb +63 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09bd3363586991ca0799eeb965c4f711e9d5c403'
|
4
|
+
data.tar.gz: 5247400f5c50f5c8ecb11bb9f03fc92d57097ba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2fb33879856577e99383f6c7f7a374707d8781efc62190cd667a46a66935c0d6d7eb82333ea490af45c7941378de83e0538bfb3526590636883d47b4d71ba11
|
7
|
+
data.tar.gz: '087615593fadb5122b9a5ae35a2b64f3a300bf7e89e623496c505b5791a2e056160bbb693266ea94a5d8ace3f518d2e91c067fd388ef744689b5aa7233f3e15a'
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano-unformatt"
|
7
|
-
spec.version = '1.
|
7
|
+
spec.version = '1.10'
|
8
8
|
spec.authors = ["unformatt"]
|
9
9
|
spec.email = ["unformatt@gmail.com"]
|
10
10
|
spec.description = "Custom recipes for Unformatt projects"
|
@@ -2,16 +2,66 @@ upstream <%=fetch(:application)%> {
|
|
2
2
|
server <%="#{fetch(:app_server_host)}:#{fetch(:app_server_port)}"%>;
|
3
3
|
}
|
4
4
|
|
5
|
-
<%- if fetch(:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
<%- if fetch(:nginx_protocols,[]).map(&:to_s).include?('http') -%>
|
6
|
+
<%- if fetch(:nginx_redirect_to_ssl, fetch(:nginx_use_ssl, false)) -%>
|
7
|
+
server {
|
8
|
+
listen <%= fetch(:nginx_http_port, 80) %>;
|
9
|
+
server_name <%=fetch(:nginx_http_server_names,fetch(:nginx_server_names))%>;
|
10
|
+
rewrite ^ https://$server_name$request_uri? permanent;
|
11
|
+
}
|
12
|
+
<%- else -%>
|
13
|
+
server {
|
14
|
+
listen <%= fetch(:nginx_http_port, 80) %>;
|
15
|
+
server_name <%=fetch(:nginx_server_names)%>;
|
16
|
+
root <%=current_path%>/public;
|
17
|
+
access_log <%=fetch(:nginx_access_log, "#{shared_path}/log/nginx-access.log") %>;
|
18
|
+
error_log <%=fetch(:nginx_error_log, "#{shared_path}/log/nginx-error.log")%>;
|
19
|
+
rewrite_log on;
|
20
|
+
|
21
|
+
client_max_body_size <%=fetch(:nginx_max_body_size, '4G')%>;
|
22
|
+
keepalive_timeout <%=fetch(:nginx_keepalive_timeout, '5')%>;
|
23
|
+
|
24
|
+
if (-f $document_root/public/maintenance.html) {
|
25
|
+
rewrite ^(.*)$ /public/maintenance.html;
|
26
|
+
break;
|
27
|
+
}
|
28
|
+
|
29
|
+
location ~ ^/(assets)/ {
|
30
|
+
root <%=current_path%>/public;
|
31
|
+
gzip_static on;
|
32
|
+
expires max;
|
33
|
+
add_header Cache-Control public;
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
|
37
|
+
location / {
|
38
|
+
try_files $uri/index.html $uri.html $uri @<%=fetch(:application)%>;
|
39
|
+
|
40
|
+
error_page 404 /404.html;
|
41
|
+
error_page 422 /422.html;
|
42
|
+
error_page 500 502 503 504 /500.html;
|
43
|
+
error_page 403 /403.html;
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
|
47
|
+
location @<%=fetch(:application)%> {
|
48
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
49
|
+
proxy_set_header Host $http_host;
|
50
|
+
proxy_headers_hash_bucket_size <%=fetch(:nginx_hash_bucket_size, 1024)%>;
|
51
|
+
proxy_headers_hash_max_size <%=fetch(:nginx_hash_max_size, 512)%>;
|
52
|
+
proxy_read_timeout <%=fetch(:nginx_read_timeout, 60)%>;
|
53
|
+
proxy_send_timeout <%=fetch(:nginx_send_timeout, 60)%>;
|
54
|
+
proxy_redirect off;
|
55
|
+
proxy_pass http://<%=fetch(:application)%>;
|
56
|
+
include proxy_params;
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
<%- end -%>
|
11
61
|
<%- end -%>
|
12
62
|
|
63
|
+
<%- if fetch(:nginx_protocols,[]).map(&:to_s).include?('https') -%>
|
13
64
|
server {
|
14
|
-
<%- if fetch(:nginx_use_ssl) -%>
|
15
65
|
listen <%= fetch(:nginx_https_port, 443) %>;
|
16
66
|
ssl on;
|
17
67
|
ssl_certificate <%=fetch(:nginx_ssl_certificate)%>;
|
@@ -19,15 +69,16 @@ server {
|
|
19
69
|
ssl_session_cache shared:SSL:10m;
|
20
70
|
ssl_session_timeout 5m;
|
21
71
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
22
|
-
|
72
|
+
<%- if fetch(:nginx_ssl_ciphers,'').present? -%>
|
73
|
+
ssl_ciphers "<%= fetch(:nginx_ssl_ciphers) %>";
|
23
74
|
ssl_prefer_server_ciphers on;
|
24
|
-
ssl_dhparam /etc/ssl/private/dhparams.pem
|
75
|
+
ssl_dhparam <%= fetch(:nginx_dhparams_path, '/etc/ssl/private/dhparams.pem') %>;
|
25
76
|
<%- end -%>
|
26
77
|
|
27
78
|
server_name <%=fetch(:nginx_server_names)%>;
|
28
79
|
root <%=current_path%>/public;
|
29
|
-
access_log <%=shared_path
|
30
|
-
error_log <%=shared_path
|
80
|
+
access_log <%=fetch(:nginx_access_log, "#{shared_path}/log/nginx-access.log") %>;
|
81
|
+
error_log <%=fetch(:nginx_error_log, "#{shared_path}/log/nginx-error.log")%>;
|
31
82
|
rewrite_log on;
|
32
83
|
|
33
84
|
client_max_body_size <%=fetch(:nginx_max_body_size, '4G')%>;
|
@@ -59,9 +110,7 @@ server {
|
|
59
110
|
location @<%=fetch(:application)%> {
|
60
111
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
61
112
|
proxy_set_header Host $http_host;
|
62
|
-
<%- if fetch(:nginx_use_ssl) -%>
|
63
113
|
proxy_set_header X-Forwarded-Proto https;
|
64
|
-
<%- end -%>
|
65
114
|
proxy_headers_hash_bucket_size <%=fetch(:nginx_hash_bucket_size, 1024)%>;
|
66
115
|
proxy_headers_hash_max_size <%=fetch(:nginx_hash_max_size, 512)%>;
|
67
116
|
proxy_read_timeout <%=fetch(:nginx_read_timeout, 60)%>;
|
@@ -72,3 +121,4 @@ server {
|
|
72
121
|
break;
|
73
122
|
}
|
74
123
|
}
|
124
|
+
<%- end -%>
|