<div dir="ltr"><br><br>On 7 October 2015 at 08:15, Tom Browder <<a href="mailto:tom.browder@gmail.com">tom.browder@gmail.com</a>> wrote:<br>><br>> On Wed, Oct 7, 2015 at 9:39 AM, WK <<a href="mailto:wanradt@gmail.com">wanradt@gmail.com</a>> wrote:<br>> ...<br>> > I think the most common setup for Dancer app is to run it with some<br>> > Plack-capable server (like Starman) behind some reverse proxy (like<br>> > nginx).<br>> ...<br>><br>> Without a clear set of docs for deployment, I'm not sure I want to<br>> leap into that steep learning curve.<br><br><div>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.</div><div><br></div><div>    ProxyPass        / <a href="http://localhost:5001/">http://localhost:5001/</a><br></div><div>    ProxyPassReverse / <a href="http://localhost:5001/">http://localhost:5001/</a></div><div><br></div><div>and then run plackup to serve Dancer content on port 5001:<br></div><div><br></div><div>plackup -s Starman<span style="font-size:13px"> --workers=10</span> -p 5001 bin/app.psgi<br></div><div><br></div><div>If you want Apache to serve static content (images, js, css, etc.), you can use Apache's rewrite directives:</div><div><br></div><div><div><span style="white-space:pre">  </span>RewriteEngine On<br></div><div><span class="" style="white-space:pre"> </span>RewriteRule<span style="white-space:pre">  </span>^/static/(.*)<span style="white-space:pre">        </span>/path/to/public/$1 [L]</div></div><div><span style="white-space:pre">    ProxyPass</span><span style="white-space:pre">    /</span><span style="white-space:pre">    <a href="http://localhost:5001/">http://localhost:5001/</a></span><br></div><div><span style="white-space:pre">   ProxyPassReverse</span><span style="white-space:pre">     /</span><span style="white-space:pre">    <a href="http://localhost:5001/">http://localhost:5001/</a></span><span style="white-space:pre"><br></span></div><div><br></div><div>Anything under /static/ here gets served from the directory /path/to/public/ by Apache, and all other requests get served by Dancer. </div><div><br></div><div>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.</div><div><br></div><div>Good luck!</div><div>Amelia.</div><div><br></div></div>