Changing the URL that gets logged?

Comments

2 comments

  • Ilya Kaplan

    What happens is that when the VCL is run after the restart req.url is new, so `req.http.x-original-url = req.url` saves the new url as `x-original-url`.

    I suggest you do:

    if (!req.http.x-original-url) { set req.http.x-original-url = req.url; }

    as early as possible in vcl_recv, and in the vcl_log change %{req.url}V to `%{ if(req.http.x-original-url, req.http.x-original-url, req.url) }V`

    0
    Comment actions Permalink
  • JD Weiner

    Oh yeah, now that you explain it, it makes sense.  :^) Thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.