capistrano-generals 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5cfafd2788270fa55b0f631c3a66da6621bdc50
4
- data.tar.gz: 4a866226d9a0000ac70b7a2010276478059387d9
3
+ metadata.gz: c5e57a16544bbd49b10dad7f8cfb9dd62ab69ed1
4
+ data.tar.gz: baa7acb4e3203391187fd1c21f63d4db5c6d5729
5
5
  SHA512:
6
- metadata.gz: fdd94fba01c7372f6037742824a9daa6e86d2f819b05a4f7a5055e25164a56637d431aece1913f04a76a1cfb0e21ebbe418abca7f77e74549fdf302e4b84d965
7
- data.tar.gz: fdd93d1e0f96671ae8911d8a88fb47e2a46b4955f93a8c98c55816a3c25b215124f4deaf12fc1281f9ed4694ae150a08388450bcfa5a3d03dd067aa286729589
6
+ metadata.gz: 58780943a33a415f348922db65c40dc18cd2366b675a2b21ddc94763269148b2a9060f905285ea06f1dbdffe523c176d1f1cc7e71ec384edf8112e3d384b75b4
7
+ data.tar.gz: 12c53e959ae704971b1a372b45497f100d987827a9cffced84884407c2756e4a9cb4ebce17f7041de86087cbbb736d3129f81fea2a2039795869b73b502c91df
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Generals
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -14,8 +14,11 @@ namespace :load do
14
14
  set :nginx_redirect_www, true
15
15
  set :nginx_fail_timeout, 0
16
16
  set :nginx_x_frame_options, 'DENY'
17
- set :ngingx_strict_transport_security, true
17
+ set :ngingx_strict_transport_security, false
18
18
  set :nginx_respond_to_subdomains, false
19
+ set :nginx_resolver, '8.8.4.4 8.8.8.8 valid=300s'
20
+ set :nginx_resolver_timeout, '10s'
21
+ set :nginx_custom_block, ''
19
22
 
20
23
  # Nginx ssl settings
21
24
  set :nginx_use_ssl, false
@@ -24,6 +27,11 @@ namespace :load do
24
27
  set :nginx_ssl_protocols, 'TLSv1 TLSv1.1 TLSv1.2'
25
28
  set :nginx_ssl_session_cache, 'shared:SSL:10m'
26
29
 
30
+ # Nginx caching settings
31
+ set :cache_static_files, true
32
+ set :cache_custom, ''
33
+ set :cache_custom_expire, 'max'
34
+
27
35
  # SSL Settings
28
36
  set :local_certs_folder, 'config/deploy/certs'
29
37
  set :remote_certs_folder, '/etc/ssl'
@@ -19,9 +19,9 @@ server {
19
19
  listen 80;
20
20
  server_name www.<%= fetch(:server_domain) %>;
21
21
  <% if fetch(:nginx_use_ssl) %>
22
- return 301 https://<%= fetch(:server_domain) %>$request_uri;
22
+ return 302 https://<%= fetch(:server_domain) %>$request_uri;
23
23
  <% else %>
24
- return 301 http://<%= fetch(:server_domain) %>$request_uri;
24
+ return 302 http://<%= fetch(:server_domain) %>$request_uri;
25
25
  <% end %>
26
26
  }
27
27
  <% end %>
@@ -29,7 +29,7 @@ server {
29
29
  server {
30
30
  listen 80;
31
31
  server_name <%= "*.#{fetch(:server_domain)}" if fetch(:nginx_respond_to_subdomains) %> <%= fetch(:server_domain) %>;
32
- rewrite ^(.*) https://$host$1 permanent;
32
+ return 302 https://<%= fetch(:server_domain) %>$request_uri;
33
33
  }
34
34
  <% end %>
35
35
 
@@ -39,6 +39,8 @@ server {
39
39
  server_name <%= "*.#{fetch(:server_domain)}" if fetch(:nginx_respond_to_subdomains) %> <%= fetch(:server_domain) %>;
40
40
  root <%= current_path %>/public;
41
41
 
42
+ <%= fetch(:nginx_custom_block) %>
43
+
42
44
  client_max_body_size 4G;
43
45
  keepalive_timeout 10;
44
46
 
@@ -57,8 +59,11 @@ server {
57
59
  <% if fetch(:nginx_ssl_stapling) %>
58
60
  ssl_stapling on;
59
61
  ssl_stapling_verify on;
60
- resolver 8.8.4.4 8.8.8.8 valid=300s;
61
- resolver_timeout 10s;
62
+ <% end %>
63
+
64
+ <% if fetch(:nginx_resolver).length > 0 %>
65
+ resolver <%= fetch(:nginx_resolver) %>;
66
+ resolver_timeout <%= fetch(:nginx_resolver_timeout) %>;
62
67
  <% end %>
63
68
 
64
69
  <% if fetch(:ssl_server_ciphers) %>
@@ -110,17 +115,18 @@ server {
110
115
  }
111
116
  <% end %>
112
117
 
113
- location ~* ^/assets/ {
114
- # Per RFC2616 - 1 year maximum expiry
115
- expires 1y;
118
+ <% if fetch(:cache_static_files) %>
119
+ location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js)$ {
120
+ expires max;
116
121
  add_header Cache-Control public;
122
+ }
123
+ <% end %>
117
124
 
118
- # Some browsers still send conditional-GET requests if there's a
119
- # Last-Modified header or an ETag header even if they haven't
120
- # reached the expiry date sent in the Expires header.
121
- add_header Last-Modified "";
122
- add_header ETag "";
123
- break;
125
+ <% if fetch(:cache_custom).length > 0 %>
126
+ location <%= fetch(:cache_custom) %> {
127
+ expires <%= fetch(:cache_custom_expire) %>;
128
+ add_header Cache-Control public;
124
129
  }
130
+ <% end %>
125
131
 
126
132
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-generals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stef Schenkelaars
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano