Sha256: 252123402802560695750fa3b5af47d6c418e291241adb2926538a9ca6fd2be8

Contents?: true

Size: 1.9 KB

Versions: 26

Compression:

Stored size: 1.9 KB

Contents

upstream <%= @config.app_name %> {
	server unix:/tmp/unicorn.<%= @config.app_name %>.sock fail_timeout=0;
}

server {
  listen 443 ssl;
  server_name <%= @config.domain %>;

  index index.html;
  root /home/deploy/apps/<%= @config.app_name %>/public;
  try_files $uri/index.html $uri @app;

  location @app {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    # enable this if you forward HTTPS traffic to unicorn,
    # this helps Rack set the proper URL scheme for doing redirects:
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://<%= @config.app_name %>;
  }

  client_max_body_size 100m;

  error_page 500 502 503 504 /500.html;

  location ~ ^/assets/ {
    expires 1y;
    add_header Cache-Control public;
    add_header ETag "";

    if ($request_filename ~* ^.*?\.(eot)|(ttf)|(woff)|(svg)|(otf)$){
      add_header Access-Control-Allow-Origin *;
    }
    break;
  }

  location ~ ^/(assets)/  {
    root /home/deploy/apps/<%= @config.app_name %>/public;
    gzip_static on; # to serve pre-gzipped version
    expires max;
    add_header Cache-Control public;
  }

  # Let's Encrypt certificates
  ssl_certificate /etc/letsencrypt/live/<%= @config.domain %>/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/<%= @config.domain %>/privkey.pem;

  location /home/deploy/apps/<%= @config.app_name %>/public/.well-known {
  	allow all;
  }
}


server {
  listen 80;
  server_name <%= @config.domains.join(' ') %>;
  return 301 https://<%= @config.domain %>$request_uri;
}

<% if @config.www_domain %>
server {
  listen 443 ssl;
  server_name <%= @config.www_domain %>;
  return 301 $scheme://<%= @config.domain %>$request_uri;

  # Let's Encrypt certificates
  ssl_certificate /etc/letsencrypt/live/<%= @config.domain %>/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/<%= @config.domain %>/privkey.pem;
}
<% end %>

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
railman-0.6.13 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.12 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.11 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.10 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.9 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.8 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.7 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.6 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.5 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.4 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.3 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.2 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.1 templates/rails_app/config/server/nginx.conf.tt
railman-0.6.0 templates/rails_app/config/server/nginx.conf.tt
railman-0.5.2 templates/rails_app/config/server/nginx.conf.tt
railman-0.5.1 templates/rails_app/config/server/nginx.conf.tt
railman-0.5.0 templates/rails_app/config/server/nginx.conf.tt
railman-0.4.0 templates/rails_app/config/server/nginx.conf.tt
railman-0.3.7 templates/rails_app/config/server/nginx.conf.tt
railman-0.3.6 templates/rails_app/config/server/nginx.conf.tt