Created
May 26, 2010 12:28
-
-
Save sharifulin/414411 to your computer and use it in GitHub Desktop.
Accel redirect for nginx and mojo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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