Commit 8272849b authored by Xavier Guimard's avatar Xavier Guimard

First Nginx configuration that runs !!!

To see it, launch 'make e2e_tests TESTWEBSERVER=nginx'

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/trunk@4377 1dbb9719-a921-0410-b57f-c3a383c2c641
parent 57e4b3bb
......@@ -323,7 +323,7 @@ start_web_server: all prepare_test_server
elif test "$(TESTWEBSERVER)" = "nginx"; then \
echo "Launching nginx"; \
$(NGINX) -p `pwd`/e2e-tests \
-g 'error_log /home/xavier/dev/lemonldap/e2e-tests/conf/nginx.log;' \
-g 'error_log '`pwd`'/e2e-tests/conf/nginx.log;' \
-c `pwd`/e2e-tests/nginx.conf \
2>&1 | grep -v 'Permission denied' || true; \
echo "Launching plackup"; \
......@@ -370,7 +370,7 @@ plackup:
--exec /usr/bin/plackup -- \
-s FCGI \
--listen e2e-tests/conf/llng.sock \
e2e-tests/handler-server.psgi
e2e-tests/llng.psgi
#
# INSTALL
......@@ -477,7 +477,7 @@ install_webserver_conf:
cp -f _example/etc/handler-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/manager-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/test-apache$(APACHEVERSION).conf $(RCONFDIR); \
cp -f _example/etc/handler-nginx.conf $(RCONFDIR); \
cp -f _example/etc/*-nginx.conf $(RCONFDIR); \
fi
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g; \
s#__PORTALDIR__#$(PORTALDIR)/#g; \
......
server {
listen __PORT__;
server_name test1.example.com;
server_name test1.__DNSDOMAIN__;
root /var/www/html;
......
server {
listen __PORT__;
server_name manager.__DNSDOMAIN__;
root __MANAGERDIR__;
rewrite ^/$ /manager.psgi last;
if ($uri !~ ^/(static|doc|fr-doc|lib)) {
rewrite ^/(.*)$ /manager.psgi/$1 break;
}
location /manager.psgi {
include /etc/nginx/fastcgi_params;
fastcgi_pass __PSGISERVERSOCKET__;
fastcgi_param LLTYPE manager;
fastcgi_param SCRIPT_NAME /manager.psgi;
}
location / {
try_files $uri $uri/ =404;
}
}
server {
listen __PORT__;
server_name auth.__DNSDOMAIN__;
root __PORTALDIR__;
rewrite ^/$ /auth.psgi last;
location /auth.psgi {
include /etc/nginx/fastcgi_params;
fastcgi_pass __PSGISERVERSOCKET__;
fastcgi_param LLTYPE auth;
fastcgi_param SCRIPT_NAME /manager.psgi;
}
location / {
try_files $uri $uri/ =404;
}
}
#!/usr/bin/env plackup
use lib 'lemonldap-ng-common/blib/lib';
use lib 'lemonldap-ng-handler/blib/lib';
use Lemonldap::NG::Handler::PSGI::Server;
Lemonldap::NG::Handler::PSGI::Server->run({});
#!/usr/bin/env perl
use warnings;
BEGIN {
$pwd = `pwd`;
chomp $pwd;
eval qq{
use lib "$pwd/lemonldap-ng-common/blib/lib";
use lib "$pwd/lemonldap-ng-handler/blib/lib";
use lib "$pwd/lemonldap-ng-portal/blib/lib";
use lib "$pwd/lemonldap-ng-manager/blib/lib";
};
die $@ if ($@);
}
my %_apps;
my %builder = (
handler => sub {
require Lemonldap::NG::Handler::PSGI::Server;
return Lemonldap::NG::Handler::PSGI::Server->run( {} );
},
manager => sub {
require Lemonldap::NG::Manager;
return Lemonldap::NG::Manager->run( {} );
},
auth => sub {
require CGI::Emulate::PSGI;
require CGI::Compile;
return CGI::Emulate::PSGI->handler(
CGI::Compile->compile('lemonldap-ng-portal/example/index.pl') );
}
);
sub {
my $type = $_[0]->{LLTYPE} || 'handler';
print STDERR Dumper($_[0]);use Data::Dumper;
return $_apps{$type}->(@_) if ( defined $_apps{$type} );
if ( defined $builder{$type} ) {
$_apps{$type} = $builder{$type}->();
return $_apps{$type}->(@_);
}
die "Unknown PSGI type $type";
};
......@@ -8,6 +8,7 @@ events {
http {
sendfile on;
client_body_temp_path conf/;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment