Problem with Web interface, FreeBSD

1,078 views
Skip to first unread message

mag...@magicum.net

unread,
Sep 9, 2014, 2:15:20 AM9/9/14
to rsp...@googlegroups.com
Hello,

I have some problems with accessing Rspamd web interface.

OS: FreeBSD 10, x64

Rspamd version: 0.6.10 (installed by "pkg install rspamd" as building from ports failing on spf plugin).

Rspamd-interface static files downloaded from GIT as latest version (/auth) and another set as previous version (/rspamd/login)

Rspamd workers.conf:

# cat workers.conf
# Common workers configuration


worker
{
    type
= "normal";
    bind_socket
= "*:11333";
    http
= false;
    allow_learn
= true;
    mime
= true;
}
worker
{
    type
= "controller";
    bind_socket
= "localhost:11334";
    count
= 1;
}
worker
{
    type
= "webui";
    count
= 1;
    bind_socket
= "localhost:11336";
    password
= "password";
}





Nginx config:

server {
    listen
80;
    server_name
my.webserver.tld;
    root
/srv/www/rspamd;


#### Here I tried "/auth/" for the recent interface files and "/rspamd/" for old version.
    location  
/rspamd/ {
    proxy_pass http
://localhost:11336;
   
}



 when I open http://my.webserver.tld I can see logon page:

a) with only password request for "auth" version
b) with host and password request fpr "rspamd" version

However both version not working.

According to NGINX logs there is no problem to proxy the request to localhost:11336, however "F12" console in Chrome or Firefox still show "404 error" generated by rspamd.js

Speaking by telnet directly to localhost:11336 with requesting of /auth ot /rspamd/login repsectively also led to 404:

# telnet localhost 11336
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /rspamd/login HTTP/1.1
HOST: morana

HTTP/1.1 404 Not Found
Content-Type: text/html
Connection: close
Date: Tue, 09 Sep 2014 06:13:36 GMT
Content-Length: 154

<html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /rspamd/login was not found on this server.</p></body></html>
Connection closed by foreign host.


Please advise :)

Regards,
Ilya


Alexander Moisseev

unread,
Sep 9, 2014, 2:42:40 AM9/9/14
to rsp...@googlegroups.com
rspamd 0.6 is incompatible with the latest rspamd-interface.

https://github.com/vstakhov/rspamd-interface/issues/1

mag...@magicum.net

unread,
Sep 9, 2014, 7:22:26 AM9/9/14
to rsp...@googlegroups.com
As I indicated, I also tried previous, not latest rspamd-interface, and didn't work too.

вторник, 9 сентября 2014 г., 16:42:40 UTC+10 пользователь Alexander Moisseev написал:

Vsevolod Stakhov

unread,
Sep 9, 2014, 7:36:03 AM9/9/14
to rsp...@googlegroups.com
On 09/09/14 07:15, mag...@magicum.net wrote:
> Hello,
>
> I have some problems with accessing Rspamd web interface.
>
> OS: FreeBSD 10, x64
>
> Rspamd version: *0.6.10* (installed by "pkg install rspamd" as building
> from ports failing on spf plugin).
>
> Rspamd-interface static files downloaded from GIT as latest version
> (*/auth*) and another set as previous version (*/rspamd/login*)
You have forgotten the trailing slash here:

proxy_pass http://localhost:11336/;

Hopefully, in 0.7 there won't be such a problem.

--
Vsevolod Stakhov

mag...@magicum.net

unread,
Sep 9, 2014, 8:11:56 AM9/9/14
to rsp...@googlegroups.com
Regretfully NGINX didn't want to work with trailing slash at the end of proxy destination, generating an error.
Will reproduce at the office tomorrow and publish here.

In addition will try to rebuild the latest version with IPV6 enabled and update with details.

Thank you for assistance.




вторник, 9 сентября 2014 г., 21:36:03 UTC+10 пользователь vsevolod написал:

mag...@magicum.net

unread,
Sep 9, 2014, 9:20:08 PM9/9/14
to rsp...@googlegroups.com
Today successfully built rspamd 0.7, taken fresh interface from git. Configured.

My mistake, nginx doesn't blame proxy_pass http://127.0.0.1:11336/; with trailing slash.

Web ui opened ok.
However password not accepted, even if input is 100% correct. It shows - "Oops, password is incorrect", and asking for password again.

Switched "debug" logging in rspamd.

when I try to connect after entering password the log shows:

2014-09-10 11:10:22 #30448(controller) rspamd_http_router_finish_handler: requested known path: /
2014-09-10 11:10:22 #30448(controller) rspamd_http_router_try_file: requested file /usr/local/share/rspamd/www/index.html

Path existing, permissions ok,  file index.html existing as well.

That path - /usr/local/share/rspamd is linked to /srv/www/rsp as well to server as nginx's root for web ui page. Nginx doesn't show any errors, only ok:

203.xx.xx.xx - - [10/Sep/2014:11:16:36 +1000] "GET /auth/ HTTP/1.1" 200 10843 "http://my.webpage.tld/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36"



Desperately crying :(

mag...@magicum.net

unread,
Sep 9, 2014, 10:33:43 PM9/9/14
to rsp...@googlegroups.com
Eventually got it worked.

The reason was NGINX.

My correct config is:

server {


    listen
80;
    server_name
my.webpage.tld;
    root
/location/of/static/files;


    index index
.html;


    location
/ {
       
return 301 $scheme://$http_host/auth/$1$is_args$query_string;
   
}


    location
/auth/ {
    proxy_pass http
://localhost:11334/;

   
}


   
}


done!

====

However two problems appeared:

1. All processed mail shown came from IP: 0.2.0.0
2. All processed mail asigned to "undefined" user


Vsevolod Stakhov

unread,
Sep 17, 2014, 8:57:26 PM9/17/14
to rsp...@googlegroups.com
Actually, rspamd currently cannot process headers, such as X-Real-IP or Proxied-For. It won't be hard to add such a support. I do not understand the issue about user's name, to tell the truth...
Reply all
Reply to author
Forward
0 new messages