Sha256: d3dde73d902e86f75ec72cd600066f2bf435835c1daf31ec36daf83b14fc2d42

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

upstream unicorn_<%= fetch(:full_app_name) %> {
  server unix:/tmp/unicorn.<%= fetch(:full_app_name) %>.sock fail_timeout=0;
}

server {
  server_name <%= fetch(:server_name) %>;
  listen 80;
  root <%= fetch(:deploy_to) %>/current/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn_<%= fetch(:full_app_name) %>;
  location @unicorn_<%= fetch(:full_app_name) %> {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

<% if fetch(:enable_ssl) %>
server {
  server_name <%= fetch(:server_name) %>;
  listen 443;
  root <%= fetch(:deploy_to) %>/current/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn;
  location @unicorn {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto https;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
  ssl on;
  ssl_certificate <%= fetch(:deploy_to) %>/shared/ssl_cert.crt;
  ssl_certificate_key <%= fetch(:deploy_to) %>/shared/ssl_private_key.key;
}#
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-cookbook-0.0.4 lib/capistrano/cookbook/templates/nginx.conf.erb