From 2492d352b0a4221f21161bbe93b4af927b910161 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 15 Oct 2015 14:59:28 -0300 Subject: [PATCH] Bug 15005: Use ReverseProxyPath on plack.psgi This patch makes plack.psgi use ReverseProxyPath so %ENV{SCRIPT_NAME} is correctly set when running Koha behind a reverse proxy that changes the URI path (which is done on the Plack integration into packages). The apache includes for plack are tweaked so the needed headers are set before passing the request to the Plack backend. Signed-off-by: Tomas Cohen Arazi --- debian/templates/apache-shared-intranet-plack.conf | 1 + debian/templates/apache-shared-opac-plack.conf | 1 + debian/templates/plack.psgi | 1 + 3 files changed, 3 insertions(+) diff --git a/debian/templates/apache-shared-intranet-plack.conf b/debian/templates/apache-shared-intranet-plack.conf index 65a34a2..a5e1fb9 100644 --- a/debian/templates/apache-shared-intranet-plack.conf +++ b/debian/templates/apache-shared-intranet-plack.conf @@ -12,6 +12,7 @@ ProxyPreserveHost On # RequestHeader set X-FORWARDED-PROTO "https" + RequestHeader set "X-Forwarded-Script-Name" /cgi-bin/koha # Point the intranet site to Plack ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet" diff --git a/debian/templates/apache-shared-opac-plack.conf b/debian/templates/apache-shared-opac-plack.conf index 95787d8..1c2633a 100644 --- a/debian/templates/apache-shared-opac-plack.conf +++ b/debian/templates/apache-shared-opac-plack.conf @@ -12,6 +12,7 @@ ProxyPreserveHost On # RequestHeader set X-FORWARDED-PROTO "https" + RequestHeader set "X-Forwarded-Script-Name" /cgi-bin/koha # Point the intranet site to Plack ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac" diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi index 6da039f..30f4f0b 100644 --- a/debian/templates/plack.psgi +++ b/debian/templates/plack.psgi @@ -65,6 +65,7 @@ my $opac = Plack::App::CGIBin->new( builder { enable "ReverseProxy"; + enable "ReverseProxyPath"; enable "Plack::Middleware::Static"; mount '/opac' => $opac; -- 2.6.1