Page 1 of 1

Subsonic + lighttpd reverse proxy + fail2ban

PostPosted: Tue Nov 10, 2015 5:28 pm
by caic
Hello,

I have my Subsonic behind a lighttpd reverse proxy. I was trying to setup Fail2ban but I've realized Subsonic log server IP instead client IP:

Code: Select all
[2015-11-10 18:00:35,772] INFO LoginFailureLogger - Login failed for [admin] from [192.168.1.10]


I don't know how to fix this. I have Owncloud in the same server with the same lighttpd reverse proxy and fail2ban working correctly:

Code: Select all
{"reqId":"359ea75466baab17770cca113a3f8d20","remoteAddr":"212.36.66.87","app":"core","message":"Login failed: 'admin' (Remote IP: '212.36.66.87', X-Forwarded-For: '')","level":2,"time":"2015-11-10T15:38:25+00:00"}


i've tried mod_extforward:

Code: Select all
extforward.headers = ("X-Real-IP")
extforward.forwarder = ("192.168.1.10" => "trust")


But nothing changes.

Any idea?

Thank you.

Re: Subsonic + lighttpd reverse proxy + fail2ban

PostPosted: Tue Nov 10, 2015 6:59 pm
by grumpwagon
Must be something in your set up messing with the IP, because when I get failed logins logged, they have the correct source/client IP

Re: Subsonic + lighttpd reverse proxy + fail2ban

PostPosted: Tue Nov 10, 2015 7:22 pm
by daneren2005
grumpwagon wrote:Must be something in your set up messing with the IP, because when I get failed logins logged, they have the correct source/client IP

It is because he is behind a reverse proxy. There is already another thread for his somewhere here and we don't yet have a work around for it.

Re: Subsonic + lighttpd reverse proxy + fail2ban

PostPosted: Thu Dec 10, 2015 5:37 pm
by caic
Hello,

I have now tryed Apache as reverse proxy:

Code: Select all
<Location /musica>
   ProxyPass        http://localhost:8080/musica
   ProxyHTMLURLMap  http://localhost:8080/musica /musica
   ProxyPassReverse http://localhost:8080/musica
   RequestHeader unset Accept-Encoding
</Location>


Subsonic has this args:

Code: Select all
SUBSONIC_ARGS="--port=8080 --context-path=/musica"


But same result:

Code: Select all
[2015-12-10 18:15:17,916] INFO LoginFailureLogger - Login failed for [admin] from [127.0.0.1]


Well, not exactly the same, with Lighttpt reverse proxy Subsonit loged server IP (192.168.1.10).