lib/ms_deploy/templates/vhost.erb in ms_deploy-0.1.2 vs lib/ms_deploy/templates/vhost.erb in ms_deploy-0.1.3
- old
+ new
@@ -1,6 +1,8 @@
+<% if with_upstream_server %>
+
upstream <%= application %>_<%= stage %>_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
@@ -10,21 +12,36 @@
# for TCP setups, point these to your backend servers
# server 127.0.0.1:8080 fail_timeout=0;
# server 192.168.0.8:8080 fail_timeout=0;
# server 192.168.0.9:8080 fail_timeout=0;
}
+<% end %>
server {
- listen 80;
server_name <%= domain %>;
- client_max_body_size 4G;
+<% if protocol == 'https' %>
+ listen 443 default_server ssl;
+
+ ssl_certificate <%= nginx_cert_dir %>/<%= application %>_cert.pem;
+ ssl_certificate_key <%= nginx_cert_dir %>/<%= application %>_cert.key;
+
+ keepalive_timeout 70;
+
+<% else %>
+
+ listen 80;
+
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
# nginx so increasing this is generally safe...
#keepalive_timeout 5;
+
+<% end %>
+
+ client_max_body_size 4G;
# path for static files
root <%= project_root %>/public;
### Stop Image and Document Hijacking