ayuda con proxy

Iniciado por weggi, 31 Diciembre 2011, 19:34 PM

0 Miembros y 1 Visitante están viendo este tema.

weggi

hola , felices fiestas :P

Lo que tengo pensado hacer es basicamente que al haberse conectado el cliente al servidodr proxy redireccione a una web automaticamente.

estoy usando squid en linux y e trasteado con iptables pero aun no logro lo deseado.

alguna persona que me ilumine?

madpitbull_99

Prueba con la siguiente directiva:

always_direct dominio1 dominio2

Eso redirigía el dominio1 al dominio2. Más información.

O sino, con un script en Perl:

CitarSquid can be used a reverse proxy to load balance several web servers, instead of using a hardware load balancer. This is useful because Squid can cache a lot of the content coming from the source web servers, thereby reducing their load. However, it isn't clear how to do an Apache style direct where all hostnames other than www.hostname.com get redirected to www.hostname.com. But using a director program it can be straight-forward.

Edit Steps

1.) In Perl write a simple redirector program like this one:

Código (perl) [Seleccionar]
    #!/usr/bin/env perl
    $|=1;
    while (<>) {
      $url = m/^([^ ]*)/;
      if ($url !~ /^http:\/\/www\.hostname\.com/) {
        $url =~ s@^http://www\.hostname\.com/(.*)@http://www.hostname.com/\1@;
        print "301:$url\n";
      } else {
        print "$url\n";
      }
    }


2.) In your squid.conf file change the redirect_program variable, it's probably commented out, and specify where your redirector_program is, ex: /usr/sbin/redirect.pl

3.)  Make sure that the variable httpd_accel_uses_host_header is set to on, otherwise nothing will be redirected.




«Si quieres la paz prepárate para la guerra» Flavius Vegetius


[Taller]Instalación/Configuración y Teoría de Servicios en Red