-
Notifications
You must be signed in to change notification settings - Fork 54
/
app.psgi
executable file
·30 lines (23 loc) · 960 Bytes
/
app.psgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env perl
use Koha;
use Plack::App::CGIBin;
use Plack::Builder;
use Koha::Plack::Util;
my $app = Plack::App::CGIBin->new(root => $ENV{KOHA_BASE})->to_app;
builder {
### Enable if running behind an HTTP reverse proxy
#enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' } 'ReverseProxy';
enable 'Deflater';
### Enable these if the front-end webserver is not setting
### "Expires" headers for static content already.
#enable 'Expires',
# content_type => ['text/css', 'application/javascript', qr!^image/!],
# expires => 'access plus 1 day';
enable 'Status', path => qr{/C4/|/Koha/|/misc/|/t/|/xt/|/etc/}, status => 404;
enable 'Static', path => qr{^/opac-tmpl/}, root => 'koha-tmpl/';
enable 'Static', path => qr{^/intranet-tmpl/}, root => 'koha-tmpl/';
enable 'Header', unset => ['Status'];
enable '+Koha::Plack::Localize';
enable '+Koha::Plack::Rewrite';
mount '/' => $app;
};