Lines 41-52
my $port2app = {
Link Here
|
41 |
}; |
41 |
}; |
42 |
|
42 |
|
43 |
builder { |
43 |
builder { |
|
|
44 |
# This middleware decides which app to run (opac or intranet) depending on |
45 |
# SERVER_PORT. It must be run before ReverseProxy middleware which can |
46 |
# modify SERVER_PORT |
47 |
enable sub { |
48 |
my $app = shift; |
49 |
sub { |
50 |
my $env = shift; |
51 |
$env->{'koha.app'} = $port2app->{$env->{SERVER_PORT}} || $intranet; |
52 |
return $app->($env); |
53 |
} |
54 |
}; |
55 |
|
44 |
enable 'ReverseProxy'; |
56 |
enable 'ReverseProxy'; |
45 |
enable '+Koha::Middleware::SetEnv'; |
57 |
enable '+Koha::Middleware::SetEnv'; |
46 |
enable '+Koha::Middleware::RealIP'; |
58 |
enable '+Koha::Middleware::RealIP'; |
|
|
59 |
|
47 |
sub { |
60 |
sub { |
48 |
my $env = shift; |
61 |
my $env = shift; |
49 |
my $app = $port2app->{$env->{SERVER_PORT}} || $intranet; |
62 |
$env->{'koha.app'}->($env); |
50 |
$app->($env); |
|
|
51 |
}; |
63 |
}; |
52 |
} |
64 |
} |
53 |
- |
|
|