Running Sympa on Nginx+FastCGI

Note: This is outdated, see 978932#20

Here is just a nginx configuration file example that may be useful for others:

# based on

server {
    listen       80;

    server_name  *.*;
    root         /usr/lib/cgi-bin/sympa;
    access_log   /var/log/nginx/sympa.access.log;
    error_log    /var/log/nginx/sympa.error.log;
    error_page   403 500 502 503 504 /50x.html;

    rewrite ^/$ /wws permanent;

    # While configuring sympa, you should specify wwsympa_url for each robot.
    # if you do not do so, sympa will generate wwsympa_url as ${robot_name}/sympa.
    # So to prevent non-active urls for robots without wwsympa_url, we do this redirect:

    rewrite ^/sympa/(.*)$ /wws/$1 permanent;

    location ^~ /static-sympa/ {
        alias /var/lib/sympa/static_content/;
        access_log off;
    location /50x.html {
        root /usr/share/nginx/html;
    location ~* \.(php|pl|py|jsp|asp|sh|cgi|bin|csh|ksh|out|run|o)$ {
        deny all;
    location ~ /\.ht {
        deny all;
    location /wws {
        gzip off;
        fastcgi_pass   unix:/run/fcgiwrap.socket;
        fastcgi_split_path_info ^(/wws)(.+)$;
        fastcgi_param  QUERY_STRING       $query_string;
        fastcgi_param  REQUEST_METHOD     $request_method;
        fastcgi_param  CONTENT_TYPE       $content_type;
        fastcgi_param  CONTENT_LENGTH     $content_length;
        fastcgi_param  PATH_INFO          $fastcgi_path_info;
        fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
        fastcgi_param  REQUEST_URI        $request_uri;
        fastcgi_param  DOCUMENT_URI       $document_uri;
        fastcgi_param  DOCUMENT_ROOT      $document_root;
        fastcgi_param  SERVER_PROTOCOL    $server_protocol;
        fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
        fastcgi_param  SERVER_SOFTWARE    nginx;
        fastcgi_param  REMOTE_ADDR        $remote_addr;
        fastcgi_param  REMOTE_PORT        $remote_port;
        fastcgi_param  SERVER_ADDR        $server_addr;
        fastcgi_param  SERVER_PORT        $server_port;

        # According to RFC3875 ( in SERVER_NAME
        # we should put an actual hostname user came to. For nginx it is in $host
        # This will allow to run sympa multihost instances
        fastcgi_param  SERVER_NAME        $host;

        fastcgi_param  REMOTE_USER        $remote_user;
        fastcgi_param  SCRIPT_FILENAME    $document_root/wwsympa-wrapper.fcgi;

        fastcgi_param  HTTP_HOST           $http_host;
        fastcgi_intercept_errors on;

See Also