[Koha] Working with nginx and installing on URL prefixes
Daniel Bünzli
daniel.buenzli at erratique.ch
Sat Oct 7 00:04:20 NZDT 2023
Hello,
I’m trying to make an install of koha to consider migrating to it from another ILS.
Given our existing infrastructure the setup scheme of koha on different domains is not entirely convenient for us nor is using apache (even if only proxied by nginx we rather not add more moving part to our infrastructure).
Ideally we would like to be able to have:
1. The opac on say example.org/koha/catalogue
2. The staff interface on say example.org/koha/intranet
3. Use the official debian packages
4. Use nginx directly instead of apache
I haven’t been succeeding so far. But I’m at a point where I can `koha-plack —start mylib` and convince nginx to talk to plack on the prefixes by having:
location /koha/intranet {
include proxy_params;
proxy_pass unix:/var/run/koha/mylib/plack.sock:/intranet/mainpage.pl;
proxy_buffer_size 8k;
}
location /koha/catalogue {
include proxy_params;
proxy_pass unix:/var/run/koha/mylib/plack.sock:/opac;
proxy_buffer_size 8k;
}
I gather there’s an additional bunch of rewrites rules in the the apache configuration files that I will have to port at some point but one thing I’m stuck on is that when I try to access `example.org/koha/intranet` it redirects to the root of the domain `example.org/cgi-bin…` rather than `example.org/koha/intranet/cgi-bin…` to trigger the install procedure.
So here are two questions:
a) Is there an easy way to convince koha to root its URLs w.r.t. to the prefix we’d like them to be on ? Maybe an environment variable or a launch parameter or an http header to set in the nginx configuration ? (I’m a bit unfamiliar with the whole plack/starman eco-system)
b) Is there any strong problem I’m not seeing in trying to setup koha the way I outlined above and use nginx rather than apache to serve the app ?
Thanks,
Daniel
P.S. I also vaguely considered the `app.psgi` part of the source distribution but this workflow doesn’t seem to be documented or supported in the debian packages from which I rather not deviate too much.
More information about the Koha
mailing list