2013-07-03 11:46:29 -04:00
|
|
|
upstream <%= @server_name %> {
|
|
|
|
server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
|
2013-02-06 21:31:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2013-07-03 11:46:29 -04:00
|
|
|
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
|
2013-02-06 21:31:46 -05:00
|
|
|
listen 80;
|
2013-07-03 11:46:29 -04:00
|
|
|
root <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/public;
|
2013-07-10 12:39:55 -04:00
|
|
|
server_name <%= @server_name %> *.<%= @server_name %>;
|
2013-02-06 21:31:46 -05:00
|
|
|
|
|
|
|
client_max_body_size 50M;
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
2013-07-05 10:46:53 -04:00
|
|
|
if ($host ~* "www") {
|
|
|
|
rewrite ^(.*)$ http://<%= @server_name %>$1 permanent;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-02-06 21:31:46 -05:00
|
|
|
location = /50x.html {
|
|
|
|
root html;
|
|
|
|
}
|
2013-07-05 10:17:19 -04:00
|
|
|
|
|
|
|
try_files $uri/index.html $uri @<%= @server_name %>;
|
|
|
|
location @<%= @server_name %> {
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_pass http://<%= @server_name %>;
|
2013-02-06 21:31:46 -05:00
|
|
|
}
|
|
|
|
}
|