Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
add redirects for rubygems downloads
Browse files Browse the repository at this point in the history
dwradcliffe committed Jul 24, 2015
1 parent 7433c0e commit 82244b0
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -244,7 +244,7 @@ GRAPH
rubygems-backups (0.0.24)
chef-vault (>= 0.0.0)
rubygems-ruby (>= 0.0.0)
rubygems-balancer (0.0.62)
rubygems-balancer (0.0.63)
chef-vault (>= 0.0.0)
datadog (>= 0.0.0)
logrotate (>= 0.0.0)
2 changes: 1 addition & 1 deletion cookbooks/rubygems-balancer/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name 'rubygems-balancer'

version '0.0.62'
version '0.0.63'

depends 'chef-vault'
depends 'datadog'
8 changes: 8 additions & 0 deletions cookbooks/rubygems-balancer/templates/default/site.conf.erb
Original file line number Diff line number Diff line change
@@ -53,6 +53,10 @@ server {
include <%= node['nginx']['dir'] %>/filters.conf; # managed by chef
include <%= node['nginx']['dir'] %>/blacklist.conf; # not managed by chef

location ~ /rubygems/rubygems(.*)\.(tgz|zip|gem)$ {
rewrite ^ http://rubygems.global.ssl.fastly.net$request_uri redirect;
}

location ~ /gems/(.*)\.gem$ {
set $gem $1;
post_action /__log;
@@ -218,6 +222,10 @@ server {
include <%= node['nginx']['dir'] %>/filters.conf; # managed by chef
include <%= node['nginx']['dir'] %>/blacklist.conf; # not managed by chef

location ~ /rubygems/rubygems(.*)\.(tgz|zip|gem)$ {
rewrite ^ https://rubygems.global.ssl.fastly.net$request_uri redirect;
}

##### BEGIN legacy rules

location = /__log {

0 comments on commit 82244b0

Please sign in to comment.