#Dada Mail (or any other CGI) on Nginx
DISCLAIMER: DO NOT rely on this for production (yet)! I'm not done testing it out.
Nginx does not have built in support for traditional CGI applications (of which Dada Mail is one), so it won't work out of the box.
To make a very long story short, here are a Plack wrapper script and nginx configuration that I have found seem to work.
Notes:
- You will, of course, need to install the appropriate Plack CPAN modules (and be prepared to wait a very long time for the install to complete).
- I used Starman to run the Plack script, but you can use any Plack-compatible server that you want.
- Note that the
exec_cb => sub { 1 }
is extremely important. Without that line, you will have some things that work, but most won't, because the application will think that it is running as the folder name it is in, instead of as the CGI script itself. (In other words,self_url
will return "http://lists.example.com/" instead of "http://lists.example.com/dada/mail.cgi".) However, the primary purpose of this line is actually to allow things likefork()
to work; it forces the CGI file to be forked and executed instead of compiled into a persistent PSGI app.