Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Simple redirect

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


kokoniimasu at gmail

Feb 9, 2012, 8:59 AM

Post #1 of 3 (188 views)
Permalink
Simple redirect

Hi,

Varnish redirect is necessary to write in two actions.
I tried to be simply redirect.

For example, to redirect http://www.example.com


import rewrite;
sub vcl_recv{
error( rewrite.location( 302,"http://www.example.com/" ) );
}


vcl_error is not necessary

blog-post:
http://blog.xcir.net/index.php/2012/02/varnish-redirect-operation-to-easylibvmod-rewrite/

code:
https://github.com/xcir/libvmod-rewrite


and wrote code to simplify the output of the varnishlog.
http://blog.xcir.net/index.php/2012/02/convert-varnishlog-output-to-easy/


I hope that this code is of help to you.

--
Syohei Tanaka(@xcir)
http://xcir.net/

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


perbu at varnish-software

Feb 10, 2012, 5:57 AM

Post #2 of 3 (183 views)
Permalink
Re: Simple redirect [In reply to]

hi,

On Thu, Feb 9, 2012 at 5:59 PM, kokoniimasu <kokoniimasu [at] gmail> wrote:

> Hi,
>
> Varnish redirect is necessary to write in two actions.
> I tried to be simply redirect.
>
> For example, to redirect http://www.example.com



>
> import rewrite;
> sub vcl_recv{
> error( rewrite.location( 302,"http://www.example.com/" ) );
> }
>


Very nice. I'll add this to the module overview once we get it up and
running (it suffered a bit when we had our server crash).

Per.



--
Per Buer, CEO
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
*Varnish makes websites fly!*
Whitepapers <http://www.varnish-software.com/whitepapers> |
Video<http://www.youtube.com/watch?v=x7t2Sp174eI> |
Twitter <https://twitter.com/varnishsoftware>


jfrias at gmail

Feb 10, 2012, 9:17 AM

Post #3 of 3 (175 views)
Permalink
Re: Simple redirect [In reply to]

your vltrans.php script to translate output is amazing, great hack!
Human readability is often sacrificed in tools.

Thanks,

-Javier

On Thu, Feb 9, 2012 at 11:59 AM, kokoniimasu <kokoniimasu [at] gmail> wrote:
> Hi,
>
> Varnish redirect is necessary to write in two actions.
> I tried to be simply redirect.
>
> For example, to redirect  http://www.example.com
>
>
>    import rewrite;
>    sub vcl_recv{
>      error( rewrite.location( 302,"http://www.example.com/" ) );
>    }
>
>
> vcl_error is not necessary
>
> blog-post:
>  http://blog.xcir.net/index.php/2012/02/varnish-redirect-operation-to-easylibvmod-rewrite/
>
> code:
>  https://github.com/xcir/libvmod-rewrite
>
>
> and wrote code to simplify the output of the varnishlog.
>  http://blog.xcir.net/index.php/2012/02/convert-varnishlog-output-to-easy/
>
>
> I hope that this code is of help to you.
>
> --
> Syohei Tanaka(@xcir)
> http://xcir.net/
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.