anchor.diff:    error_log     <%= remote_path_for(shared_path) %>/log/nginx.error.log;
   
     ssl on;
  -  ssl_certificate       /etc/nginx/sites-admin/ssl-certificates/server.crt;
  -  ssl_certificate_key   /etc/nginx/sites-admin/ssl-certificates/server.key;
  +  ssl_certificate       <%= remote_path_for(shared_path) %>/config/ssl/server.crt;
  +  ssl_certificate_key   <%= remote_path_for(shared_path) %>/config/ssl/server.key;
  +
  +  error_page 502 @maintenance;
  +  error_page 503 @maintenance;
   
     location / {
  -    try_files $uri @deploy_it;
  +    if (-f <%= remote_path_for(shared_path) %>/tmp/maintenance.txt) {
  +      return 503;
  +    }
  +
  +    try_files $uri @rails;
     }
   
  -  location @deploy_it {
  -    # Headers
  -    include /etc/nginx/proxy_params;
  -
  -    # Options
  -    proxy_redirect     off;
  -    proxy_read_timeout 300;
  -
  -    # Pass to Rails
  -    proxy_pass http://<%= fetch(:application) %>-puma;
  +  location = /check.json {
  +    try_files $uri @rails_nologs;
     }
   
  -  location /faye {
  +  location ~ ^/(sidekiq|logs|check)/ {
  +    try_files $uri @rails_nologs;
  +  }
  +
  +  location /cable {
       # Headers
       include /etc/nginx/proxy_params;
   
  
positive.code:     proxy_connect_timeout     850000;
  
      # Pass to Faye
      proxy_pass http://<%= fetch(:application) %>-faye;
    }
  }
  
negative.code: upstream <%= fetch(:application) %>-puma {
    server unix:<%= remote_path_for(shared_path) %>/tmp/sockets/puma.sock fail_timeout=0;
  }
  
  <%- config = fetch(:nginx_vhost, {}) -%>
  