Sha256: f24e41beda1bff8a80780a791f177c545b3963eab654c85f326cc59a54818af5

Contents?: true

Size: 1.49 KB

Versions: 11

Compression:

Stored size: 1.49 KB

Contents

upstream <%= fetch(:nginx_upstream_name) %> {
  server unix:<%= fetch(:nginx_upstream_file) %> fail_timeout=<%= fetch(:nginx_fail_timeout) %>;
}

server {
    server_tokens off;
    add_header X-Content-Type-Options nosniff;
    client_max_body_size 4G;
    keepalive_timeout 10;

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

    server_name <%= fetch(:nginx_server_name) %>;
    root <%= current_path %>/public;
    try_files $uri/index.html $uri @<%= fetch(:nginx_upstream_name) %>;

    location @<%= fetch(:nginx_upstream_name) %> {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://<%= fetch(:nginx_upstream_name) %>;

        access_log <%= fetch(:nginx_access_log_file) %>;
        error_log <%= fetch(:nginx_error_log_file) %>;
    }

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

    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|PATCH|POST|DELETE|OPTIONS)$ ){
        return 405;
    }

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

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
capistrano-simple-unicorn-1.1.5 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano3-unicorn-nginx-0.1.1 lib/generators/capistrano3/unicorn_nginx/templates/nginx_conf.erb
capistrano3-unicorn-nginx-0.1.0 lib/generators/capistrano3/unicorn_nginx/templates/nginx_conf.erb
capistrano3-unicorn-nginx-0.0.4 lib/generators/capistrano3/unicorn_nginx/templates/nginx_conf.erb
capistrano-simple-unicorn-1.1.4 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-unicorn-1.1.3 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-unicorn-1.1.2 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-unicorn-1.1.1 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-unicorn-1.1.0 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-unicorn-1.0.0 lib/generators/capistrano/simple_unicorn/templates/nginx_conf.erb
capistrano-simple-nginx-0.0.1 lib/templates/nginx_conf.erb