Bug 35812: Fix search URL aliases in Plack Apache config

Mimic missing stuff from apache-shared-opac.conf into apache-shared-opac-plack.conf, where /search and /opac-search.pl aliases were missing.

Note that while RewriteRule applies before reverse proxy directives and works, ScriptAlias applies purely to standard cgi perl scripts, meaning it didn't apply there.

Now it's mimicked analogously to how /index.html is configured.

This patch fixes an issue where someone might have just a reverse proxy to Plack configured without native Perl scripting, where this URL would then otherwise be failing.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Michał Kula 2024-03-27 13:25:49 +01:00 committed by Katrin Fischer
parent bc58644a32
commit 9628e6a529
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -14,10 +14,14 @@
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"
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 /search "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-search.pl"
ProxyPassReverse /search "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-search.pl"
ProxyPass /opac-search.pl "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-search.pl"
ProxyPassReverse /opac-search.pl "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac/opac-search.pl"
# Point the /api endpoint to Plack
RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl