How to set Perl Dancer environment with uWSGI (to be used with nginx)

448 Views Asked by At

I'm attempting to start a Perl Dancer app in a production environment.

I'm invoking uWSGI as follows:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl

and while the app loads and runs, it is laden with errors because no environment gets set at all (not even the default development environment).

These do not appear to work:

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env production
uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl production

FYI, this works, using plackup & starman:

plackup -E production -s Starman --workers=10 -l /tmp/app.sock -a ./bin/app.pl

I have read through this: http://uwsgi-docs.readthedocs.org/en/latest/Options.html but there doesn't appear to be a Dancer-specific environment setting, such as there is for Python.

Thoughts? Thx in advance!

1

There are 1 best solutions below

1
On

Ok, just answered my own question.

uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl --env PLACK_ENV=production

Hope this is helpful to others.