Score:0

Is there a way to proxy a request with Nginx without client knowing the request was proxied?

cn flag

I have an app making a request to www.example.com/blocked that is blocked by a browser plugin which results with an error GET http://www.example.com/blocked net::ERR_BLOCKED_BY_CLIENT. When in the app I change the request to go instead to my Nginx www.myproxyserver.ml/proxy, where I then proxy the request to the original website, the app still comes back with the same error message above. I am trying to find a way not to reveal the end request back to client, rather the proxy server address.

This is the Nginx config:

server {
        server_name                     myproxyserver.ml;
        access_log                      off;
        resolver                        8.8.8.8 ipv6=off;

        location /proxy {
                proxy_set_header        Accept-Encoding "";
                proxy_pass              https://www.example.com/blocked;
                break;
        }
        listen 80;
        listen 443 ssl;
}

I have tried setting the headers with proxy_set_header in the config for various settings, but didn't manage to properly proxy the request, rather just redirect it.

Thank you.

vidarlo avatar
ar flag
This isn't a issue with how the proxy works, but how the browser plugin works. Figure out that, possibly by looking into the source of the plugin.
Ante avatar
cn flag
It's an ad blocker plugin that blocks requests that contain a certain keyword. For instance, 'ads', 'analytics' etc. Say url on my server that I want to hit is 'example.com/analytics', it will get blocked. This is what I want to route it over another url and figured Nginx proxy had a way to do it. Doesn't it?
vidarlo avatar
ar flag
It obviously doesn't solely match URL. Otherwise the reverse proxy would fool it.
Ante avatar
cn flag
@vidarlo could you please elaborate? If I change just part of the request url string, so it doesn't contain 'analytics', the plugin doesn't block the request and I get back status 404. How would you make the reverse proxy do the trick?
vidarlo avatar
ar flag
Have a look at the headers. Probably the site sends a redirect or similar. Without real hostnames and URLs it's difficult for us to debug behaviour.
djdomi avatar
za flag
i think you need to explain a hell more, what your doing not only your nginx config will not be all, since you are telling your writing(?) an app that blocks requests, i would suggest to think about at least 100% more information needed. Moreover - Please FOCUS your question!
Ante avatar
cn flag
@djdomi I think the primary problem you have here is English comprehension, not the focus of my question.
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.