some sod modz

This commit is contained in:
zhitomirskiyi 2011-01-17 13:38:02 -08:00
parent 47671ac332
commit 390e19ecdd
3 changed files with 8 additions and 3 deletions

View file

@ -2,6 +2,8 @@ thins:
- port: '3001'
- port: '3002'
- port: '3003'
url: 'alpha.joindiaspora.com'
url: 'joindiaspora.com'
cert_location: '/usr/local/nginx/conf/diaspora.crt'
key_location: '/usr/local/nginx/conf/diaspora.key'
s3_bucket: "https://joindiaspora.s3.amazonaws.com"
s3_path: "/uploads/images/'

View file

@ -29,5 +29,6 @@ end
config = YAML.load_file("/usr/local/app/diaspora/chef/cookbooks/common/files/default/thins.yml")
template "/usr/local/nginx/conf/nginx.conf" do
source "nginx.conf.erb"
variables :ports => config['thins'].map{|thin| "#{thin["port"]}"}, :url => config['url'], :cert_location => config['cert_location'], :key_location => config['key_location']
variables :ports => config['thins'].map{|thin| "#{thin["port"]}"}, :url => config['url'], :cert_location => config['cert_location'], :key_location => config['key_location'],
:s3_bucket => config['s3_bucket'] , :s3_path => config['s3_path']
end

View file

@ -109,7 +109,9 @@ http {
break;
}
rewrite ^/uploads/images/(.*)$ https://joindiaspora.s3.amazonaws.com/uploads/images/$1 permanent;
<% unless @s3_bucket.blank? || @s3_path.blank? %>
<%= "rewrite ^/uploads/images/(.*)$ #{@s3_bucket}#{@s3_path}$1 permanent; %>
<% end %>
}
error_page 500 502 503 504 /50x.html;