Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created May 26, 2010 12:28
Show Gist options
  • Select an option

  • Save sharifulin/414411 to your computer and use it in GitHub Desktop.

Select an option

Save sharifulin/414411 to your computer and use it in GitHub Desktop.
Accel redirect for nginx and mojo
package App::Controller;
...
sub redirect_accel {
my $self = shift;
my $url = shift || return;
my $type = shift || '';
$self->render_data('');
for ($self->res->headers) {
$_->content_type( $type );
$_->header( 'X-Accel-Redirect' => $url );
}
return $self;
}
...
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment