Sha256: 893b452a0f501c9f4cb771c8e719333e8007d405acf55af42b5c75f94b4ca01f

Contents?: true

Size: 1.94 KB

Versions: 7

Compression:

Stored size: 1.94 KB

Contents

upstream <%= application %> {
  server unix:/tmp/<%= application %>.sock fail_timeout=0;
}

<% if nginx_use_ssl %>
server {
  listen 80;
  rewrite ^(.*) https://$host$1 permanent;
}
<% end %>

server {
<% if nginx_use_ssl %>
  listen 443;
  ssl on;
  ssl_certificate /etc/ssl/certs/<%= nginx_ssl_certificate %>;
  ssl_certificate_key /etc/ssl/private/<%= nginx_ssl_certificate_key %>;
<% else %>
  listen 80;
<% end %>

  server_name <%= nginx_server_name %>;
  root <%= current_path %>/public;
  try_files $uri/index.html $uri @<%= application %>;

  location @<%= application %> {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
<% if nginx_use_ssl %>
    proxy_set_header X-Forwarded-Proto https;
<% end %>
    proxy_pass http://<%= application %>;
    # limit_req zone=one;
    access_log <%= shared_path %>/log/nginx.access.log;
    error_log <%= shared_path %>/log/nginx.error.log;
  }

  location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
    add_header Last-Modified "";
    add_header ETag "";

    open_file_cache max=1000 inactive=500s;
    open_file_cache_valid 600s;
    open_file_cache_errors on;
    break;
  }

  client_max_body_size 4G;

  keepalive_timeout 120;
  proxy_connect_timeout 120;
  proxy_read_timeout 120;

  error_page 500 502 504 /500.html;
  error_page 503 @503;

  location = /50x.html {
    root html;
  }

  location = /404.html {
    root html;
  }

  location @503 {
    error_page 405 = /system/maintenance.html;
    if (-f $document_root/system/maintenance.html) {
      rewrite ^(.*)$ /system/maintenance.html break;
    }
    rewrite ^(.*)$ /503.html break;
  }

  if ($request_method !~ ^(GET|HEAD|PUT|POST|DELETE|OPTIONS)$ ){
    return 405;
  }

  if (-f $document_root/system/maintenance.html) {
    return 503;
  }

  location ~ \.(php|html)$ {
    return 405;
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kapify-0.0.12 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.11 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.10 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.9 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.8 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.7 lib/generators/kapify/nginx/templates/nginx_conf.erb
kapify-0.0.6 lib/generators/kapify/nginx/templates/nginx_conf.erb