In Nginx how to allow some IPs & allow all requests from mobile devices?
<p>I want to </p>

<p>1) Deny all IP address except <code>10.1.1.1</code> (from browser)</p>

<p>2) Allow all requests from android(or any other) devices </p>

<p>I have following nginx code snippet, but it gives error</p>

<blockquote>
  <p>"allow" directive is not allowed here</p>
</blockquote>

<pre><code>location / {

            allow 10.1.1.1; //allow for this IP only and deny for all browser request
            deny  all; 
            if ($http_user_agent ~* "(android") { //allow for android user-agent for now
                 allow all; // allow access to all mobile users
            }
.
.
.}
</code></pre>

<p>How to achieve this or any alternative to do it?</p>