reproxy icon indicating copy to clipboard operation
reproxy copied to clipboard

An ability to bypass Host header

Open ffix opened this issue 2 years ago • 7 comments

Hey!

Tried to use reproxy for the first time and got some issues with services like Grafana. It looks like Grafana server doesn't handle X-Forwarded-Host header which is non-standard. But there is no ability in reproxy to bypass Host header like you can do with nginx:

proxy_set_header Host $host;

It may be implemented using command line flag or we can enable it by default. What do you think about it?

Thanks!

ffix avatar Mar 31 '22 18:03 ffix

I could try to prepare a patch for that

ffix avatar Mar 31 '22 18:03 ffix

this is the place we call the middleware handling headers https://github.com/umputun/reproxy/blob/master/app/proxy/proxy.go#L134

by default DropHeaders is empty, so I'm not sure why it will drop any header.

umputun avatar Mar 31 '22 19:03 umputun

I don't think this directive is about bypassing, but rather setting a new header?

umputun avatar Mar 31 '22 19:03 umputun

Currently I deleted this line. It fixes Host header for me. But this feature was added for some reason.

ffix avatar Mar 31 '22 19:03 ffix

i see. yeah, making a param to do this will be nice. I don't want to change the default behavior.

feel free to make a PR, thx

umputun avatar Mar 31 '22 19:03 umputun

I need the same. @ffix are you still going to implement this?

simplylizz avatar Jul 17 '22 14:07 simplylizz

I tried to fix it by adding a simple CLI argument but have understood that this behavior may vary from one container to another. So, now I am using a patched version of reproxy app but have plans to add a per-container header option. I don't have the exact date when the fix will be done. Feel free to make a PR if you want.

ffix avatar Jul 28 '22 09:07 ffix

@umputun Having this issue open indicates that this hasn't been implemented while it clearly shows the fix has been merged. Should close this as done 😄

mikelorant avatar Mar 21 '24 09:03 mikelorant

@umputun Having this issue open indicates that this hasn't been implemented while it clearly shows the fix has been merged. Should close this as done 😄

closed. usually, I let the person who opened the ticket, close it.

umputun avatar Mar 21 '24 16:03 umputun