Created
August 18, 2010 13:51
-
-
Save sharifulin/534788 to your computer and use it in GitHub Desktop.
mojo daemon + nginx = fail ?!
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
# 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