Sha256: 8d7690cef7d55390da88bd87c10cb95c091d1cae25412c7521ec5c766444a615

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

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

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

  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 Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn_<%= fetch(:full_app_name) %>;
  }

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

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

  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_<%= fetch(:full_app_name) %>;
  }

  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

2 entries across 2 versions & 1 rubygems

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