[ic] Dancer Deployment

Richard Templet richard at endpoint.com
Tue Oct 15 17:24:19 UTC 2013


On Tue, Oct 15, 2013 at 02:53:13PM +0000, William Carr wrote:
> What's the "best way" to deploy Dancer?

Bill,

This is a pretty good quick start guide:

http://perldancer.org/quickstart

Once you get the app.pl running then you can create a RewriteRule or location to proxy back to that url to pass things into Dancer. We normally use nginx just for the smaller footprint so we setup something like this in nginx:

location / {
    proxy_cache everything;
    proxy_cache_use_stale updating;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto http;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://app_server;
    proxy_pass_header Set-Cookie;
    proxy_read_timeout 300s;
    proxy_intercept_errors on;
}

where app_server is defined as:

upstream app_server {
    server 127.0.0.1:5000 fail_timeout=0;
}

The location is defined in the server sections and the upstream is defined in the http section.

In Apache we just setup a rewrite rule in the VirtualHost like so:

RewriteRule    ^/ http://127.0.0.1:5000/$1 [P]

Once you get ready for it to go into production then we normally use Starman and plackup to setup a few daemons to handle proxying requests from Apache or nginx to Dancer.

Let me know if you want something more specific.  

Thanks,

Richard






More information about the interchange-users mailing list