Как изменить параметр URL с помощью прозрачного прокси

http://www.serverdensity.com/

веб-инструмент, можно установить копию на собственном сервере, затем установить агенты на машинах, должен был контролироваться.

0
задан 7 August 2013 в 19:02
1 ответ

You can use SQUID, which is a more commonly used as a proxy, to accomplish what you are attempting. The url_rewrite_program option allows for requests to be sent to a script for rewriting.

The following script would substitute the url in the manor you describe:

#!/usr/bin/perl

while (<>) {
        @line = split;
        $_ = $line[0];

        if (m|http://google.com/\?hl=en|) {
                # do some replacement work
                $_ =~s|\?hl=en|\?hl=fr|g;
                print $_,"\n";
        } else {
                # send the request directly
                print $_;
        }
}

If you prefer to use apache, it sounds like it can be done with a combination of mod_proxy and mod_rewrite. See this page on apache.org for a tutorial.

1
ответ дан 4 December 2019 в 18:05

Теги

Похожие вопросы