Mailman with nginx and thttpd

Igor Sysoev igor at sysoev.ru
Tue Oct 26 08:46:33 MSD 2010


On Mon, Oct 25, 2010 at 05:02:53PM -0700, David Newman wrote:

> Greetings. I'm getting 404 errors after installing the Mailman mailing
> list manager on a server running nginx and thttpd, and could use some
> help in understanding why.
> 
> This is on "Mailserver", an excellent OpenBSD-based mail appliance from
> Allard Consulting that uses nginx. I've pasted the current nginx and
> thttpd configs below; the configs are based on Manlio Perillo's howto here:
> 
> http://wiki.list.org/display/DOC/Mailman+and+nginx
> 
> In my setup, the hostname is mail.suctest.com. I've created a separate
> virtual host in nginx called 'lists.suctest.com' for the Mailman stuff.
> 
> The logs say requests to Mailman URLs such as this one:
> 
> http://lists.suctest.com/mailman/listinfo
> 
> produce 404 errors in both nginx and thttpd, although it's the latter
> server that returns the error page. The Mailman stuff is in
> /usr/local/mailman and is group readable by mailman.
> 
> Thanks in advance for clues on answering these two questions:
> 
> 1. How to point nginx and thttp at the correct locations so that I'm not
> getting 404s?
> 
> 2. If possible, how to run Mailman under the canonical hostname of
> 'mail.suctest.com' instead of the separate name of 'lists.suctest.com'?

nginx.org runs Mailman's CGI using mini_httpd. This is a simple server by
the same author as thttpd. I have also patched mini_httpd to support
X-Real-IP header. Here is a configuration part related to Mailman:

        location = /mailman/ {
            proxy_pass         http://127.0.0.1/cgi-bin/listinfo;
            proxy_set_header   Host       nginx.org;
            proxy_set_header   X-Real-IP  $remote_addr;
        }

        location /mailman/ {
            proxy_pass         http://127.0.0.1/cgi-bin/;
            proxy_set_header   Host       nginx.org;
            proxy_set_header   X-Real-IP  $remote_addr;
        }

        location = /cgi-bin/ {
            proxy_pass         http://127.0.0.1/cgi-bin/listinfo;
            proxy_set_header   Host       nginx.org;
            proxy_set_header   X-Real-IP  $remote_addr;
        }

        location /cgi-bin/ {
            proxy_pass         http://127.0.0.1/cgi-bin/;
            proxy_set_header   Host       nginx.org;
            proxy_set_header   X-Real-IP  $remote_addr;
        }

        location /pipermail/ {
            alias  /usr/local/mailman/archives/public/;
        }

Mailman URL is "http://nginx.org/mailman/" due to
   proxy_set_header   Host   nginx.org;

mini_httpd configuraiton is:

user=www 
host=127.0.0.1
port=80
dir=/usr/local/mailman
cgipat=cgi-bin/*
pidfile=/var/run/mini_httpd.pid
xrealip=127.0.0.1


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list