Mailman with nginx and thttpd

David Newman dnewman at networktest.com
Mon Dec 20 01:54:38 MSK 2010


Hi Igor and nginx fans,

Back in October Igor helped get me going with Mailman on nginx. Things
are mostly working fine, except I just noticed I'm getting 403 forbidden
errors when trying to access Mailman archives. Web access to other parts
of Mailman (info and admin pages) works OK.

How to correct archive permissions?

I've pasted configs and errors below.

Thanks in advance!

dn

from nginx.conf (note that 'domain1.tld' is in place of a real domain):

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

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

        location /icons {
            proxy_redirect   off;
            alias /usr/local/mailman/icons;
        }

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

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

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

from mini_httpd.conf:

user=_nginx
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

from /usr/local/mailman/archives/public:

lrwxr-xr-x  1 root  mailman  43 Dec 19 14:51 somelist@ ->
/usr/local/mailman/archives/private/somelist

from /var/log/httpd.err, after each attempt to see a public archive:

2010/12/19 14:36:59 [error] 3917#0: *1
"/usr/local/mailman/archives/public/somelist/index.html" is forbidden
(13: Permission denied), client: 205.147.16.129, server:
mail.domain1.tld, request: "GET /pipermail/somelist/ HTTP/1.1", host:
"mail.domain1.tld", referrer:
"https://mail.domain1.tld/mailman/listinfo/somelist"




On 10/25/10 9:46 PM, Igor Sysoev wrote:
> 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
> 
> 



More information about the nginx mailing list