Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created August 18, 2010 13:51
Show Gist options
  • Save sharifulin/534788 to your computer and use it in GitHub Desktop.
Save sharifulin/534788 to your computer and use it in GitHub Desktop.
mojo daemon + nginx = fail ?!
# mojo code
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
shift->render(t => join '', 1..50_000);
} => 'index';
app->start;
__DATA__
@@ index.html.ep
<!DOCTYPE html>
<html lang="en">
%= $t
</body>
</html>
# mojo test
#!/usr/bin/env perl
use strict;
use Test::More tests => 3;
use Test::Mojo;
my $t = Test::Mojo->new;
my $r = $t->get_ok('http://domain.com:8080/')
->status_is(200)
->tx->res
;
like $r, qr{</html>}, 'ok';
# nginx.conf
# default conf here
server {
listen 8080;
server_name domain.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment