Created
May 15, 2011 06:39
-
-
Save tene/972924 to your computer and use it in GitHub Desktop.
basic psgi worker running on nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use v5.010; | |
use Dancer; | |
get '/' => sub { | |
return <<'ROOT'; | |
<p>root</p> | |
<p><a href="/bye">Bye</a></p> | |
ROOT | |
}; | |
get '/bye' => sub { | |
return <<'BYE'; | |
<p>Bye!</p> | |
<p><a href="/">Root</a></p> | |
BYE | |
}; | |
sub { | |
my $env = shift; | |
my $request = Dancer::Request->new( $env ); | |
Dancer->dance( $request ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apphandler: 'PSGI' | |
log: 'core' | |
logger: 'file' | |
log_path: 'logs' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 1234; | |
server_name localhost sweeks-laptop; | |
location / { | |
include /etc/nginx/fastcgi.conf; | |
fastcgi_pass unix:/tmp/fcgi.sock; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
plackup -s FCGI --listen /tmp/fcgi.sock --nproc 10 -a app.psgi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment