Hello liushaobo,
from steve bajic i got a while ago a working config for dspam in nginx,
maybe the vhost-file he gave me, can help you.
server {
server_name .dspam.XXXXXX.de;
root /var/www/dspam.XXXX.de/htdocs;
access_log /var/www/dspam.XXXXX.de/logs/access_log main;
error_log /var/www/dspam.XXXXX.de/logs/error_log info;
index index.html index.htm index.php;
#====================================================
# FCGI parameters for Perl
#====================================================
include /etc/nginx/fastcgi_params;
fastcgi_index dspam.cgi;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
#====================================================
#====================================================
# Add cgi-bin support
#====================================================
location ~ ^/cgi\-bin/.*\.(cgi|pl)$ {
auth_pam "DSPAM WebUI - Restricted Access";
auth_pam_service_name "system-postfixadmin";
gzip off;
root /var/www/dspam.XXXXXXXXX.de;
fastcgi_pass 127.0.0.1:8000;
fastcgi_read_timeout 5m;
fastcgi_index index.cgi;
}
#====================================================
#====================================================
location / {
fastcgi_index dspam.cgi;
if (!-f $request_filename) {
rewrite ^/(.*)$
http://$host/cgi-bin/dspam.cgi permanent;
break;
}
if ($request_filename ~*
"^.+\.(awk|sql|ini|tpl|css|js|jpe?g|gif|png|ico|jar|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf)$")
{
expires max;
break;
}
if ($request_filename ~* "^.+\.cgi(\?.*)?$") {
fastcgi_pass 127.0.0.1:8000;
}
}
location ^~ /cgi-bin/templates {
internal;
}
#====================================================
}
kind regrads from germany,
marko
On Mon, 6 Sep 2010 10:20:37 +0000, liushaobo <[email protected]> wrote:
>> Date: Mon, 6 Sep 2010 10:02:20 +0100
>> From: [email protected]
>> To: [email protected]
>> CC: [email protected]
>> Subject: Re: [Dspam-user] Configure dspam-web in nginx
>>
>> liushaobo wrote:
>> >
>> >
>> > > Date: Sun, 5 Sep 2010 09:08:00 +0100
>> > > From: [email protected]
>> > > To: [email protected]
>> > > CC: [email protected]
>> > > Subject: Re: [Dspam-user] Configure dspam-web in nginx
>> > >
>> > > liushaobo wrote:
>> > > >
>> > > >
>> > > > hello
>> > > >
>> > > > I user centos-5 , postfix-2.6.0-1, I not used nginx, not
configure
>> > > > nginx ,
>> > > > Want to know how to configure nginx in dspam-web,Did not know
>> > > > where
>> > > > was wrong;
>> > > >
>> > > > nginx.conf configure
>> > > > location /dspam/ {
>> > > > alias /var/www/dspam/cgi-bin/;
>> > > > fastcgi_index dspam.cgi;
>> > > > auth_basic "Dspam auth";
>> > > > auth_basic_user_file /var/www/dspam/cgi-bin/.htpasswd;
>> > > > }
>> > > >
>> > > >
>> > > > nginx error.log
>> > > >
>> > > > 2010/09/05 12:35:18 [error] 26017#0: *2 directory index of
>> > > > "/var/www/dspam/cgi-bin/" is forbidden , client: 123.158.x.x,
>> > > > server:
>> > > > 116.254.x.x, request: "GET /dspam/ HTTP/1.1", host:
"mail.xxxx.com"
>> > >
>> > > liuhaobo,
>> > >
>> > > You are missing some things to make ngnix work for you. Go read
about
>> > > 'spawn-fcgi'
>> > >
>> > > I will paste you an example of nginx+dspam-webui configuration
(Once
>> > > you
>> > > have this working then change to SSL) and I hope that helps you
learn
>> > > what you need to do. The example uses PAM->Mysqltable for
>> > > authentication, you can use something else.
>> > >
>> > >
>> > > server {
>> > > listen 80 default rcvbuf=64k backlog=128;
>> > > server_name 127.0.0.1 localhost [SERVER.DOMAIN.TLD] "";
>> > > access_log /var/log/nginx-access.log main;
>> > > error_log /var/log/nginx-error.log info;
>> > > root /usr/local/www/nginx-dist;
>> > > index index.html index.htm;
>> > > include /usr/local/etc/nginx/fastcgi_params;
>> > > fastcgi_index index.cgi;
>> > > fastcgi_param SCRIPT_FILENAME $doc ument_root$fastcgi_script_name;
>> > > fastcgi_param QUERY_STRING $query_string;
>> > >
>> > >
>> > >
>> > > location ~*
>> > >
>> >
"^/dspam/((admins|subadmins|configure\.pl|default\.prefs|rgb\.txt)(\?.*)|templates(/?.*)?)$"
>> > > {
>> > > internal;
>> > > }
>> > > location ^~ /dspam/ {
>> > > auth_pam "DSPAM WebUI - Restricted Access";
>> > > auth_pam_service_name "dspam-webui";
>> > > fastcgi_index dspam.cgi;
>> > > fastcgi_read_timeout 15m;
>> > > if (!-f $request_filename) {
>> > > rewrite . http://$host/dspam/dspam.cgi permanent;
>> > > break;
>> > > }
>> > >
>> > > if ($request_filename ~* "^.+\.cgi(\?.*)?$") {
>> > > fastcgi_pass 127.0.0.1:9000;
>> > > }
>> > > }
>> > >
>> > >
>> > >
>> > > location ~ ^/cgi\-bin/.*\.(cgi|pl)$ {
>> > > gzip off;
>> > > root /usr/local/www;
>> > > fastcgi_pass 127.0.0.1:9000;
>> > > fastcgi_read_timeout 15m;
>> > > fastcgi_index index.cgi;
>> > > #fastcgi_param DOCUMENT_ROOT /usr/local/www;
>> > > # fastcgi_param SCRIPT_FILENAME /usr/local/www$fastcgi_script_name;
>> > >
>> > >
>> >
>> >
>> > hello
>> > Thanks material which you provide,I do not understand the nginx
>> > configuration,
>> > For example "fastcgi_pass 127.0.0.1:9000;" ,Why uses 9000 port?
>> > I follow your document test, no 。I further study, thanks
>> >
>> >
>> |# yum install spawn-fcgi
>>
>> You then start as a service on port 9000
>> Google for 'spawn-fcgi' or nginx + perl + cgi
>>
>> When your nginx loads a .cgi or .pl from the /cgi-bin/ folder is passes
>> it to 127.0.0.1:9000 to spawn-fcgi to process
>>
>>
>> You may also need to add this to /etc/ngnix/||fastcgi_params|
>> |
>> fastcgi_param REMOTE_USER $remote_user;
>> fastcgi_pass_header Authorization;
>> fastcgi_intercept_errors off;
>>
>>
>> LIST: I'm no nginx expert, so please correct me if i'm wrong
>>
>> |
>
>
> hi,I have configured 'spawn-fcgi'
>
> “tcp 0 0 127.0.0.1:9000 0.0.0.0:*
> LISTEN ”
>
>
>
> The following nginx error ,Please help me , thanks
>
>
>
> # /etc/init.d/nginx restart
> [emerg]: "fastcgi_pass" directive is not allowed here in
> /etc/nginx/nginx.conf:96
> configuration file /etc/nginx/nginx.conf test failed
>
>
>
>
>
> nginx.conf:96 red line:
>
>
>
> location
>
~*"^/dspam/((admins|subadmins|configure\.pl|default\.prefs|rgb\.txt)(\?.*)|templates(/?.*)?)$"
> {
> internal;
> }
>
> # location ^~ /dspam/ {auth_pam "DSPAM WebUI - Restricted Access";
> # auth_pam_service_name "dspam-webui";
> auth_basic "Restricted";
> auth_basic_user_file
/var/www/extsuite/dspam/cgi-bin/.htpasswd;
> fastcgi_index dspam.cgi;
> fastcgi_read_timeout 15m;
> if (!-f $request_filename) {
> rewrite . http://$host/dspam/dspam.cgi permanent;
> break;
> }
>
> if ($request_filename ~* "^.+\.cgi(\?.*)?$") {
> fastcgi_pass 127.0.0.1:9000;
> }
> }
>
> location ~ ^/cgi\-bin/.*\.(cgi|pl)$ {
> gzip off;
> root /usr/www/extsuite/dspam/cgi-bin;
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_read_timeout 15m;
> fastcgi_index index.cgi;
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Dspam-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-user