Rewrite URL Glype (nginx)

I have a Glype proxy and I want to rewrite the url. All URLs on the page are automatically converted to: http://proxy.com/browse.php?u= [URL HERE]. Example: if I go to / in Pirate Bay on my proxy, I want to convert the url from this:

proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Fbrowse&b=0

      

For this:

proxy.com/tpb/browse

      

As you can see, the whole part:

browse.php?u=http%3A%2F%2Fthepiratebay.se%2F

      

Goes away (and &b=0

what's behind the url). And it has the same domain structure as The Pirate Bay.

I've tried something like this:

        location /tpb/ {
        rewrite ^/browse.php?u=(.*)$ /$1? last;
        break;
            }

      

But it doesn't work. Anyone have an answer? Another feature is also welcome. (For example, fastcgi_split_path_info

or something else that is compatible with nginx)

(If you want to see an example, go to tpb.piratenpartij.nl , but I'm not sure if they are using Glype)

+3


source to share


1 answer


I think it proxy.com/tpb/browse.php?u=http%3A%2F%2Fthepiratebay.se%2Fbrowse&b=0

will match location /tpb/browse.php

, so you can write

location /tpb/browse.php {
    rewrite ^/tpb/browse\.php.* $host/tpb/browse redirect;
}

      



Hope it does what you wanted it to do, doesn't that care? u = do you really need this?

Let me know if it works, I have nothing to try now.

0


source







All Articles