my-boxen/modules/projects/templates/shared/nginx.conf.erb
Paulo L F Casaretto 6529283e81 Change nginx.conf.erb to silence warnings
server_name without '@' was causing deprecation warnings.
2013-07-03 12:46:29 -03:00

38 lines
834 B
Text

upstream <%= @server_name %> {
server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
}
server {
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= scope.lookupvar "boxen::config::srcdir" %>/<%= @name %>/public;
server_name <%= @server_name %>;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
if ($host ~* "www") {
rewrite ^(.*)$ http://<%= @server_name %>$1 permanent;
break;
}
location = /50x.html {
root html;
}
location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://<%= @server_name %>;
break;
}
}
}