Navigation Menu

Skip to content

Commit

Permalink
use a different example for the rewriting recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 9, 2014
1 parent b8c2dde commit 3b02e41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -279,11 +279,11 @@ that passes along additional information with C<X-*> headers. In such cases
you can use the hook L<Mojolicious/"before_dispatch"> to rewrite incoming
requests.

# Change scheme if "X-Forwarded-Protocol" header is set to "https"
# Change scheme if "X-Forwarded-HTTPS" header is set
app->hook(before_dispatch => sub {
my $c = shift;
$c->req->url->base->scheme('https')
if $c->req->headers->header('X-Forwarded-Protocol') eq 'https';
if $c->req->headers->header('X-Forwarded-HTTPS');
});

Since reverse proxies generally don't pass along information about path
Expand Down

0 comments on commit 3b02e41

Please sign in to comment.