Hi.
I've moved some of our webservers to litespeed but I've stumbled upon across two problems already.
Ive got litespeed behind varnish reverse proxy that is updating the x-forwarded-for header
litespeed is correctly extracting the x-forwarded-for IP, php reports it correctly
except this doesnt seem to work when it comes to the ddos protection
for some reason one of our websites is getting the errors:
and immediately following I find that the reverse proxy's ip has been blocked instead.
i've tried changing the client throttling settings. increased the max url and header sizes. added its ip to the access control list with T for trusted. but nothing seems to prevent the error.
i cannot work out what is causing the error or why. not enough information is provided.
even worse, is that because of the errors litespeed is assuming a dos attack, and is blocking it. but its blocking the wrong ip. it blocks the reverse proxy instead!
ive had to bypass varnish specifically for this site, because nobody can get to the site as soon as it errors like this.
naturally you cannot trust a dos attacker's x-forwarded-for header, so i can understand why the wrong ip might get blocked here
im also uncomfortable trusting anyone but my own proxy's x-forwarded-for header. this is quite a security problem in my opinion.
lsws needs to allow input of a list of ip's to trust to extract x-forwarded-for, and ignore it from any other ip.
this will also mean you could also trust the x-forwarded-for ip for ddos blocking.
I've moved some of our webservers to litespeed but I've stumbled upon across two problems already.
Ive got litespeed behind varnish reverse proxy that is updating the x-forwarded-for header
litespeed is correctly extracting the x-forwarded-for IP, php reports it correctly
except this doesnt seem to work when it comes to the ddos protection
for some reason one of our websites is getting the errors:
Code:
2011-06-07 22:58:38.996 [INFO] [xxx.xxx.xxx.xxx:57876-0] Status 400: Unexpected request body 330 bytes for request: /api!
2011-06-07 22:58:39.025 [INFO] [xxx.xxx.xxx.xxx:58771-0] Status 400: Unexpected request body 329 bytes for request: /api!
2011-06-07 22:58:39.093 [INFO] [xxx.xxx.xxx.xxx:58773-0] Status 400: Unexpected request body 326 bytes for request: /api!
2011-06-07 22:58:39.162 [INFO] [xxx.xxx.xxx.xxx:58777-0] Status 400: Unexpected request body 330 bytes for request: /api!
2011-06-07 22:58:39.231 [INFO] [xxx.xxx.xxx.xxx:58783-0] Status 400: Unexpected request body 330 bytes for request: /api!
2011-06-07 22:58:39.302 [INFO] [xxx.xxx.xxx.xxx:58785-0] Status 400: Unexpected request body 329 bytes for request: /api!
2011-06-07 22:58:39.371 [INFO] [xxx.xxx.xxx.xxx:58787-0] Status 400: Unexpected request body 329 bytes for request: /api!
2011-06-07 22:58:39.441 [INFO] [xxx.xxx.xxx.xxx:58791-0] Status 400: Unexpected request body 326 bytes for request: /api!
2011-06-07 22:58:39.535 [INFO] [xxx.xxx.xxx.xxx:58793-0] Status 400: Unexpected request body 327 bytes for request: /api!
2011-06-07 22:58:39.606 [INFO] [xxx.xxx.xxx.xxx:58800-0] Status 400: Unexpected request body 330 bytes for request: /api!
2011-06-07 22:58:39.739 [INFO] [xxx.xxx.xxx.xxx:57915-0] Status 400: Unexpected request body 329 bytes for request: /api!
i've tried changing the client throttling settings. increased the max url and header sizes. added its ip to the access control list with T for trusted. but nothing seems to prevent the error.
i cannot work out what is causing the error or why. not enough information is provided.
even worse, is that because of the errors litespeed is assuming a dos attack, and is blocking it. but its blocking the wrong ip. it blocks the reverse proxy instead!
ive had to bypass varnish specifically for this site, because nobody can get to the site as soon as it errors like this.
naturally you cannot trust a dos attacker's x-forwarded-for header, so i can understand why the wrong ip might get blocked here
im also uncomfortable trusting anyone but my own proxy's x-forwarded-for header. this is quite a security problem in my opinion.
lsws needs to allow input of a list of ip's to trust to extract x-forwarded-for, and ignore it from any other ip.
this will also mean you could also trust the x-forwarded-for ip for ddos blocking.
Last edited: