Score:0

A proxy forward to redirect some calls to avoid crossing the proxy. Only redirect proxy forward

cn flag

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: network diagram

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.

sa flag
maybe stop looking for the keyword "proxy". This server is not a proxy. It's just a normal server.
albertoiNET avatar
cn flag
Hello @user253751. The word is totally correct. It is a proxy because it is a middle element that intercept calls to outside, and in this case, redirect or forward to another destination. Also is correct use proxy, because I want to use with env vars HTTPS_PROXY and HTTP_PROXY. So, it's a proxy
sa flag
How does curl know *not* to use the proxy the second time?
Score:0
in flag

Unlike Squid, Varnish is a reverse caching proxy. Its role is to cache content from the origin server and is hosted on the edge. The DNS record for example.com should be pointed to the Varnish server.

If that's not the case and you're just using the proxy locally, you're looking for a forward proxy like Squid.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.