tbusch has asked for the wisdom of the Perl Monks concerning the following question:
My Perl script is the following:PSGI: Failed to run Perl Application: Undefined subroutine &main::1 called.
and my NGINX unit config is:#!/usr/bin/perl use strict; use Mojolicious::Lite; get '/' => {text => 'Hello World'}; app->start;
Am I missing an environment variable ? It seems like Mojo is unable to detect in which environment it is. I have a similar setup for uWSGI where it works. Curiously the following script works in NGINX Unit:{ "type": "perl", "processes": 5, "script": "/etc/unit/app.psgi", "environment": { "MOJO_MODE": "production" } }
Any help or hint would be immensely appreciated.#!/usr/bin/perl use strict; use warnings; use Plack::Builder; my $app = sub { my $env = shift; [200, [], ["Hello world from PSGI!\n"]]; }; builder { enable 'ContentLength'; $app; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Mojolicious with NGINX Unit
by beech (Parson) on Feb 25, 2019 at 04:45 UTC | |
|
Re: Using Mojolicious with NGINX Unit
by tbusch (Sexton) on Feb 23, 2019 at 19:21 UTC | |
by Veltro (Hermit) on Feb 23, 2019 at 21:20 UTC |