Skip to content

Instantly share code, notes, and snippets.

@arodland
Last active December 25, 2015 03:18
Show Gist options
  • Save arodland/6908363 to your computer and use it in GitHub Desktop.
Save arodland/6908363 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use MyApp;
use Plack::Builder;
my $app = MyApp->apply_default_middlewares(MyApp->psgi_app);
builder {
enable sub {
my $app = shift;
sub {
my $env = shift;
$env->{'psgi.url_scheme'} = 'https';
$env->{SERVER_PORT} = 48443;
return $app->($env);
}
};
$app;
};
use strict;
use warnings;
use MyApp;
my $app = MyApp->apply_default_middlewares(MyApp->psgi_app);
sub {
my $env = shift;
$env->{'psgi.url_scheme'} = 'https';
$env->{SERVER_PORT} = 48443;
return $app->($env);
};
use strict;
use warnings;
use MyApp;
use Plack::Builder;
use Plack::Middleware::ReverseProxy;
use Plack::Middleware::RequestHeaders;
my $app = MyApp->apply_default_middlewares(MyApp->psgi_app);
builder {
enable "RequestHeaders",
set => [ "X-Forwarded-Port" => 48443, "X-Forwarded-Proto" => "https" ];
enable "ReverseProxy";
$app;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment