Renamed directory to follow convention.
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Deployment / NGINXUnit / PSGI.pod
CommitLineData
846bb5d7 1=head1 NAME
2
a405ae02 3Catalyst::Manual::Deployment::NGINXUnit::PSGI - Deploying Catalyst with NGINX Unit
846bb5d7 4
5=head1 NGINX Unit
6
7Catalyst runs under L<NGINX Unit|https://unit.nginx.org> using PSGI.
8
9=head2 Configuration
10
11To configure a Catalyst app in NGINX Unit, upload a JSON configuration
12snippet via Unit's config API, available at an IP socket or a Unix domain
13socket (depending on Unit's L<startup settings|
14https://unit.nginx.org/installation/#installation-startup>):
15
16 # curl -X PUT --data-binary @config.json --unix-socket \
17 /path/to/control.unit.sock http://localhost/config
18
19A minimal L<configuration|https://unit.nginx.org/configuration/#perl>
20includes a listener and an application entity:
21
22 {
23 "listeners": {
24 "127.0.0.1:8080": {
25 "pass": "applications/catalyst_app"
26 }
27 },
28
29 "applications": {
30 "catalyst_app": {
31 "type": "perl",
32 "script": "/path/to/apps/myapp/myapp.psgi",
33 "user": "catalyst_user",
34 "group": "catalyst_group"
35 }
36 }
37 }
38
39The C<script> should point to your app's C<.psgi> file; C<user> and
40C<group> should have appropriate access rights.
41
42After a successful reconfiguration, you can manage your Catalyst
43app via the same L<config API|
44https://unit.nginx.org/configuration/#applications>.
45
46=over
47
48Note: make sure the app's C<.psgi> file includes the C<lib/>
49directory:
50
51 use lib 'lib';
52 use myapp;
53
54=back
55
56=head1 MORE INFO
57
58For more information on NGINX Unit, visit: L<http://unit.nginx.org>
59
60=head1 AUTHORS
61
62Catalyst Contributors, see Catalyst.pm
63
64=head1 COPYRIGHT
65
66This library is free software. You can redistribute it and/or modify it under
67the same terms as Perl itself.
68
69=cut