~charmers/charms/precise/rails/trunk

« back to all changes in this revision

Viewing changes to hooks/chef/cookbooks/nginx/templates/default/site.conf.erb

  • Committer: Pavel Pachkovskij
  • Date: 2013-08-21 10:46:29 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: pavel.pachkovskij@gmail.com-20130821104629-zgrf6efx90tkf0ps
add rvm-installer, move cookbooks to CHARM_DIR

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
upstream rack {
2
 
  server localhost:8080;
3
 
}
4
 
 
5
 
server {
6
 
  listen 80 default_server;
7
 
  #  server_name "";
8
 
 
9
 
  keepalive_timeout 5;
10
 
 
11
 
  root <%= node[:rack][:root] %>/current/public;
12
 
 
13
 
  access_log <%= node[:rack][:root] %>/current/log/nginx.access.log;
14
 
  error_log <%= node[:rack][:root] %>/current/log/nginx.error.log;
15
 
 
16
 
  # this rewrites all the requests to the maintenance.html
17
 
  # page if it exists in the doc root. This is for capistrano's
18
 
  # disable web task
19
 
  if (-f $document_root/maintenance.html) {
20
 
    rewrite ^(.*)$ /maintenance.html last;
21
 
    break;
22
 
  }
23
 
 
24
 
  location / {
25
 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26
 
    proxy_set_header Host $http_host;
27
 
 
28
 
    # If the file exists as a static file serve it directly without
29
 
    # running all the other rewite tests on it
30
 
    if (-f $request_filename) {
31
 
      break;
32
 
    }
33
 
 
34
 
    if (!-f $request_filename) {
35
 
      proxy_pass http://rack;
36
 
      break;
37
 
    }
38
 
  }
39
 
}
 
 
b'\\ No newline at end of file'