title: nginx deny all is woking but allow a ip is not working
body: <p>I have configured nginx with aws loadbalancer and all works good when I try to access my websites. I am trying to restrict access at nginx level. I need to allow access for particular ip and deny access for all, when I try this its not working. Deny all is working but allow/deny a particular ip don't work. I have tried changing the order of deny and allow but still no luck.</p>
  
  <p>Below is my code</p>
  
  <pre><code>server {
      listen  8080;    
      server_name localhost;
  
      location /{
          root /var/www/example.com/html;
      #    root  /usr/share/nginx/html;
          index  index.html index.htm;
          satisfy all;
          deny all;
          allow 10.10.10.8;
          auth_basic "example.com intra";
          auth_basic_user_file /etc/nginx/htpasswd/example.com.htpasswd;
      }
      error_page  500 502 503 504  /50x.html;
      location = /50x.html {
          root  /usr/share/nginx/html;
      }
  }
  [root@web sites-available]#
  </code></pre>
  
  <p>I need to allow and deny ip based on nginx level and not on load balancer level.</p>