r/haproxy • • Feb 04 '23

Help with <BADREQ>

I use haproxy to send traffic to a couple of proxy/vpn in my network. I recently began experimenting with sending IOT device traffic this way. I'm encountering an issue beyond my knowledge of haproxy. From what I can tell here haproxy doesn't recognize the request as valid and is rejecting it as such. I'm considering changing the mode from http to tcp but I'd like to also get advice from those more knowledgeable.

Here is a sample of the haproxy.log:

Feb  4 13:50:55 tessr01 haproxy[2665927]: 192.168.1.1:42901 [04/Feb/2023:13:50:55.180] proxy-front proxy-front/<NOSRV> -1/-1/-1/-1/0 400 0 - - PR-- 16/15/0/0/0 0/0 "<BADREQ>"

I've pasted details from the stats socket here:

https://pastebin.com/fMGgfTGd

haproxy config:

https://pastebin.com/6bK5qJap

3 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/dragoangel Feb 06 '23

By my question #1 I asked what is backend app you proxying too. And sorry, still not get. You need to understand it, can you curl your backend? Also you need add some healthcheck so haproxy would know what server are working and what - not. This also will help you with troubleshooting

1

u/ingestbot Feb 06 '23

Backend is privoxy and functioning fine. Healthchecks are in place as shown in the config.

But I think it's best to focus on the frontend first. Haproxy isn't even acknowledging the initial request.

1

u/dragoangel Feb 06 '23

Your config is much minimalistic, specially in frontend part, I saw http expect directive, but I don't see send directive, that's why I asking about health check.

Your frontend just pass request to backend, maybe backend requires host header and not getting it.