[dancer-users] Dancer NGINX configutation
Richard Reina
gatorreina at gmail.com
Tue Mar 8 15:31:08 GMT 2016
Hi Dave,
You are correct. I am obioulsy mistaken. In my development (non production)
app which I run on a local machine (not digital ocean) I use plack via
plackup -p 5000 bin/app.psgi. However, going through my old notes I now
rememeber that I was not able to incorporate plack with my starman
configuration above. I tried and for reasons that I cannot remember was
unsuccessful and opted for:
program => '/usr/local/bin/starman',
program_args => [ '--workers', '3',
'/home/starman/Almslete/bin/app.psgi' ],
Specifically, I believe that I originally tried something like:
program => 'plackup -E deployment -s Starman',
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.psgi
Any advice on how I can move forward on incorporating plack so that I can
then incorporate Plack::Middleware::Static would of course be greatly
appreciated.
Thanks
2016-03-08 9:02 GMT-06:00 Dave Cross <dave at dave.org.uk>:
>
> [ re-ordered to preserve readability ]
>
>
> Quoting Richard Reina <gatorreina at gmail.com>:
>
> 2016-03-08 8:41 GMT-06:00 Dave Cross <dave at dave.org.uk>:
>>
>> Quoting Richard Reina <gatorreina at gmail.com>:
>>>
>>> I have the following nginx configuration that I believe -- or at least
>>> hope
>>>
>>>> -- serves up my static files, like images ad videos, directly without
>>>> invoking my dancer app. Can anyone tells me if this is the case or not,
>>>> or
>>>> how I can test to see if they are indeed being served directly by NGINX?
>>>>
>>>
>>> Before you go too far down this route, have you considered using
>>> Plack::Middleware::Static instead?
>>>
>>> https://metacpan.org/pod/Plack::Middleware::Static
>>>
>>
>> Hi Dave,
>>
>> Thanks for the reply. I think I am already using it via starman.
>>
>> use Daemon::Control;
>>
>> use Cwd qw(abs_path);
>>
>> Daemon::Control->new(
>> {
>> name => "Starman",
>> lsb_start => '$syslog $remote_fs',
>> lsb_stop => '$syslog',
>> lsb_sdesc => 'Starman Short',
>> lsb_desc => 'Starman controls the web sites.',
>> path => abs_path($0),
>>
>> program => '/usr/local/bin/starman',
>> program_args => [ '--workers', '3',
>> '/home/starman/mydomain/bin/app.psgi' ],
>>
>> user => 'starman',
>> group => 'starman',
>>
>> pid_file => '/tmp/starman.pid',
>> stderr_file => '/tmp/starman.err',
>> stdout_file => '/tmp/starman.out',
>>
>> fork => 2,
>>
>> }
>> )->run;
>>
>
> I can't see an evidence of you using Plack::Middleware::Static (or,
> indeed, any Plack middleware).
>
> It would't be added to your Starman runner, it would be in your app.psgi
> (as described in the Pod that I linked to).
>
>
> Dave...
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160308/0fedfc8f/attachment.html>
More information about the dancer-users
mailing list