Tomas Cohen Arazi
302dd7bf82
This patch makes the apache configuration for the reverse proxy (required for Plack) so it sets the X-FORWARDED-PROTO header correctly for Plack::Middleware::ReverseProxy to use it. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Ulrich Kleiber <ulrich.kleiber@bsz-bw.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Since we actually resolve 19799 now (Changing language on OPAC redirects back to homepage), I will move that code to a new enh report. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
30 lines
1.3 KiB
Text
30 lines
1.3 KiB
Text
# Apache configuration settings that are shared for every Koha instance.
|
||
# This file contains settings for the Plack configuration of the OPAC.
|
||
#
|
||
# This file should be included from an instance's
|
||
# /etc/apache2/site-available file, from within the VirtualHost section
|
||
# for the OPAC.
|
||
|
||
# Plack is only available out-of-the-box for Apache 2.4.7+ setups
|
||
<IfVersion >= 2.4.8>
|
||
<IfModule mod_proxy_http.c>
|
||
|
||
ProxyPreserveHost On
|
||
|
||
RequestHeader set X-FORWARDED-PROTO "https" env=HTTPS
|
||
|
||
# Point the OPAC site to Plack
|
||
ProxyPass /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-main.pl"
|
||
ProxyPassReverse /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-main.pl"
|
||
ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac"
|
||
ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac"
|
||
|
||
# Point the /api endpoint to Plack
|
||
RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl
|
||
RewriteRule ^/api/(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L,PT]
|
||
|
||
ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||
ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api"
|
||
|
||
</IfModule>
|
||
</IfVersion>
|