How can I set an User-Agent header when empty? (Eg, HTTP/1.0)

This is what I tried so far:

```
set $ua $http_user_agent;

if ($http_user_agent = "") //also tried = false
{
    set           $ua "Fixing-Empty-User-Agent";
    proxy_pass    http://$host$request_uri;
}

proxy_connect_timeout   2;
proxy_send_timeout      10;
proxy_read_timeout      10;

proxy_set_header User-Agent: $ua;

```