Bugzilla – Attachment 109282 Details for
Bug 20582
Turn Koha into a Mojolicious application
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20582: Fix PSGI file when behind a reverse proxy
Bug-20582-Fix-PSGI-file-when-behind-a-reverse-prox.patch (text/plain), 1.32 KB, created by
Julian Maurice
on 2020-08-28 13:43:16 UTC
(
hide
)
Description:
Bug 20582: Fix PSGI file when behind a reverse proxy
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-08-28 13:43:16 UTC
Size:
1.32 KB
patch
obsolete
>From b4403b9cd00d26fbd5514acbf1fb104c5ab5ae83 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 28 Aug 2020 17:35:14 +0400 >Subject: [PATCH] Bug 20582: Fix PSGI file when behind a reverse proxy > >ReverseProxy middleware can modify SERVER_PORT which is used to >determines which app (opac or intranet) to run, so the choice should be >made before ReverseProxy middleware >--- > app.psgi | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/app.psgi b/app.psgi >index 9a0d287fc4..0824a3ebc6 100644 >--- a/app.psgi >+++ b/app.psgi >@@ -41,12 +41,24 @@ my $port2app = { > }; > > builder { >+ # This middleware decides which app to run (opac or intranet) depending on >+ # SERVER_PORT. It must be run before ReverseProxy middleware which can >+ # modify SERVER_PORT >+ enable sub { >+ my $app = shift; >+ sub { >+ my $env = shift; >+ $env->{'koha.app'} = $port2app->{$env->{SERVER_PORT}} || $intranet; >+ return $app->($env); >+ } >+ }; >+ > enable 'ReverseProxy'; > enable '+Koha::Middleware::SetEnv'; > enable '+Koha::Middleware::RealIP'; >+ > sub { > my $env = shift; >- my $app = $port2app->{$env->{SERVER_PORT}} || $intranet; >- $app->($env); >+ $env->{'koha.app'}->($env); > }; > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20582
:
74173
|
74517
|
74518
|
74519
|
74520
|
79648
|
81687
|
81857
|
82423
|
84526
|
84527
|
84528
|
84529
|
84530
|
84531
|
91009
|
99267
|
103633
|
103720
|
103721
|
109282
|
109283
|
109284
|
109895
|
109896
|
109897
|
109898
|
109899
|
109900
|
111282
|
111315
|
111374