Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Fix sf redirect for #109
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminws committed Feb 20, 2014
1 parent 7643b7d commit 7951836
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cookbooks/pydotorg-redesign/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
license "BSD"
description "Configuration for new.python.org"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.2"
version "0.1.3"

depends "application_nginx"
depends "application_python"
Expand Down
7 changes: 5 additions & 2 deletions cookbooks/pydotorg-redesign/templates/default/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ server {
return 302 http://legacy.python.org/dev/peps/$1;
}

location /sf/ {
return 301 http://legacy.python.org/sf/;
location ~ ^/sf(.*)$ {
if ($is_args != "") {

This comment has been minimized.

Copy link
@benjaminws

benjaminws Feb 20, 2014

Author Member

Actually, duh, I could do better than this and say:

return 301 http://legacy.python.org/sf$is_args$args;

since $is_args is ? if there are args, or empty if not, and args would be empty if there are none.

Also, if we're going to move the code that handles this to to the new server, should probably start 302'ing instead.

lmk and I'll fix that all up tomorrow

return 301 http://legacy.python.org/sf?$args;
}
return 301 http://legacy.python.org/sf;
}

<% @resource.static_files.each do |url, path| %>
Expand Down

2 comments on commit 7951836

@loewis
Copy link
Contributor

@loewis loewis commented on 7951836 Feb 20, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the long-term plan for legacy.python.org is, but I suggest that the effort is better spent into implementing /sf/ urls directly in the site, instead of redirecting to legacy (of course, in addition bugs.python.org should redirect right away to the issue).

@benjaminws
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Knowing what I know about the script that does the redirect in dinsdale, I'm inclined to completely bypass the legacy redirect, and go straight to bugs from nginx.

@coderanger @gutworth

Please sign in to comment.