nginx and mailman: forward to listinfo by default

0

I struggle now for quite a bit with the problem to get mailman and nginx running. Everything works fine but if the user vists just the domain, i get a HTTP 502 error.

How can i say nginx that it should use /listinfo as the default location? I can not specifiy it via the try_files $uri /listinfo in the location / section because then every site is forwarded to /listinfo. Somehow this does not work well with cgis...

This is my current config:

server {
    listen [::]:80;
    root /usr/lib/cgi-bin/mailman/;

    location = /mailman/listinfo {
        rewrite ^ /listinfo permanent;
    }

    location / {
        fastcgi_split_path_info (^/[^/]*)(.*)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/fcgiwrap.socket;
    }
    location /images/mailman {
        alias /usr/share/images/mailman;
    }
    location /pipermail {
        alias /var/lib/mailman/archives/public;
        autoindex on;
    }
}

Can i define a location to match an url like http://example.com/ (without any parameter given)?

reox

Posted 2015-01-13T18:20:12.373

Reputation: 915

Answers

0

I fixed it by adding a rule that matches only /:

location = / { 
    rewrite ^ /listinfo permanent;
}   

if anyone has a better solution please post it!

reox

Posted 2015-01-13T18:20:12.373

Reputation: 915