I'm trying to redirect with 301 some https calls with some proxy forward. The idea is not to go through the proxy, but to return a 301 redirect with the new location. I've got two cases:
https://example.com/dummy/copy/this/path -> https://another.com/other/copy/this/path
So when I call a curl
https_proxy=myforwardproxy:8080 curl https://example.com/dummy/copy/this/path
It should return a redirection 301 to https://another.com/other/copy/this/path with the Host changes and the path reused (avoiding dummy parent path)
I'll try with Nginx, Squid, Varnish, and skipper with the same result.
This is the real thing that I want to do:
Which program will should use? I see that the only can do a redirect proxy forward is Squid, but it uses Redirection Programs (perl scripts or deprecated solutions).
Also I tried NGINX, but need an upstream and I can't configure to avoid crossing the proxy and alwys return 400 Bad Request.
And with varnish I cant get a real Probe of Concept.