@cassidyclown Media from baest is broken since instead of inserting the media directly with correct address, it uses the default /media/ and puts a redirect which Hackney can't follow when using proxy. The bug has been open for six years. https://github.com/benoitc/hackney/issues/273 In the meantime you could probably whitelist it from proxying.
@pomstan@cassidyclown That might require some more advanced proxy that can MitM HTTPS traffic. I skimmed through Privoxy docs and haven't found anything that could do that.
@i@cassidyclown@pomstan Apparently, there is already a middleware for following redirects in Tesla. https://github.com/elixir-tesla/tesla/blob/master/lib/tesla/middleware/follow_redirects.ex It's enabled by default for Gun (which has its own problems when paired with Tesla: https://github.com/elixir-tesla/tesla/issues/552, zero comments as usual) and for dev environments. https://git.pleroma.social/pleroma/pleroma/-/blob/develop/lib/pleroma/http.ex#L105 Enabling that middleware for Hackney might've fully solved the problem with redirects as well, but for whatever reason ReverseProxy does not use Pleroma's default HTTP wrapper, instead having its own. Regardless, this would solve the issue with redirects on federation-related requests. It's not as apparent, but I couldn't just forcefetch /notice/ links with the proxy on, plus there's been at least one instance that serves actors' AP IDs on its main domain but redirects requests to them to subdomain, essentially breaking all federation.
@i@cassidyclown@pomstan Your code does work, but the request in `case res` was seemingly sending the response headers as HTTP headers for second request, so one has change the variable name to something else. I'll add some checks in case something defines follow_redirect already and then push a proper patch.
@cassidyclown@i@pomstan Still not enabling mediaproxy myself, btw. But at least I can now sleep easier knowing that the bug is circumvented at least locally.