High performance handler for Nginx

By default, LLNG-FastCGI-Server provides a FastCGI server that handles all LLNG services using a FastCGI socket.

To increase handler performances, It can be replaced by any Plack family server using for examle this simple app:

app.psgi
require Lemonldap::NG::Handler::Server::Nginx;
Lemonldap::NG::Handler::Server::Nginx->run( {} );

Example to launch it:

You must so remplace lmauth configuration in Nginx configuration file:

  location = /lmauth {
    internal;
    proxy_pass http://127.0.0.1:9090/;
 
    # Drop post datas
    proxy_pass_request_body  off;
    proxy_set_header Content-Length "";
 
    # Keep original hostname
    proxy_set_header Host $http_host;
 
    # Keep original request (LLNG server will received /llauth)
    proxy_set_header X-Original_Uri $request_uri;
  }
  ...

Using uWSGI

This configuration requires uWSGI, uWSGI PSGI plugin and Nginx uwsgi module.

$ uwsgi --plugins psgi --socket :5000 --psgi llng-server.psgi

Nginx configuration:

upstream uwsgi-test {
  server          127.0.0.1:5000;                        
}
 
server {
  location = /lmauth {
    internal;
    include uwsgi_params;
    uwsgi_pass_request_body off;
    uwsgi_param CONTENT_LENGTH "";
    uwsgi_param HOST $http_host;
    uwsgi_param X_ORIGINAL_URI  $request_uri;
    uwsgi_modifier1 5;
    uwsgi_pass uwsgi-test;
  }
  ...
}