X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=examples%2Fpublic-inbox.psgi;h=acceba3deace399b6b801720600bc0e814301fcd;hp=9fa51ba6b3583e27d3ab4c5ee5d48c6dad78868d;hb=ac6f7081a484a053ddb60a2f8b6b6487664827ac;hpb=48dbde1b098d836660d3eefbacbd57e487b3eaed diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 9fa51ba6..acceba3d 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -10,7 +10,7 @@ PublicInbox::WWW->preload; use Plack::Request; use Plack::Builder; my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; - +my $www = PublicInbox::WWW->new; builder { enable 'Chunked'; if ($have_deflater) { @@ -18,9 +18,13 @@ builder { content_type => [ 'text/html', 'text/plain', 'application/atom+xml' ]; } + + # Enable to ensure redirects and Atom feed URLs are generated + # properly when running behind a reverse proxy server which + # sets X-Forwarded-For and X-Forwarded-Proto request headers. + # See Plack::Middleware::ReverseProxy documentation for details + enable 'ReverseProxy'; + enable 'Head'; - sub { - my $req = Plack::Request->new(@_); - PublicInbox::WWW::run($req, $req->method); - } + sub { $www->call(@_) }; }