Seperate access log for requests without referrers?

Hi - I have a need for all requests that come in without a referrer to
be logged into a separate log file. Is this possible? And if so, how?
I see that the access_log can be used within the location block. The
challenge is that I need to do this within a specific location block
(and location is anyway based on uri not referrer anyway).

So for instance I want to do something like this:

    location / {

                if ($http_referrer == "")
                    access_log no_referrer.log myformat;
                else
                    access_log normal.log myformat;

            proxy_pass      http://big_server_com;
            proxy_set_header        X-Forwarded-For 

$proxy_add_x_forwarded_for;
}

Is something like this possible and if so how? Thank you!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs