On 7 October 2015 at 08:15, Tom Browder <tom.browder@gmail.com> wrote:
>
> On Wed, Oct 7, 2015 at 9:39 AM, WK <wanradt@gmail.com> wrote:
> ...
> > I think the most common setup for Dancer app is to run it with some
> > Plack-capable server (like Starman) behind some reverse proxy (like
> > nginx).
> ...
>
> Without a clear set of docs for deployment, I'm not sure I want to
> leap into that steep learning curve.
If you are already dealing with virtual hosts, adding a reverse proxy should not be all that much more difficult. If you're running Apache, you can use the ProxyPass directive to reverse proxy everything served on a certain port, e.g.
and then run plackup to serve Dancer content on port 5001:
plackup -s Starman --workers=10 -p 5001 bin/app.psgi
If you want Apache to serve static content (images, js, css, etc.), you can use Apache's rewrite directives:
RewriteEngine On
RewriteRule ^/static/(.*) /path/to/public/$1 [L]
Anything under /static/ here gets served from the directory /path/to/public/ by Apache, and all other requests get served by Dancer.
The server setup details for Dancer2 are very similar to those used by Mojolicious, Catalyst, and other PSGI-capable frameworks, so you can check their documentation for tips. I believe there was a Catalyst advent calendar article with a full nginx server config in it, and the Mojolicious wiki has some useful details too.
Good luck!
Amelia.