title: How to deny with 404 on nginx
body: <p>I want to secure some locations in nginx by supplying deny/allow directives, but I do not want outsider to know that a location is denied. I want outsider to get 404, not 403 http code. My configuration snippet is</p>
  
  <pre><code>location /admin/ {
      uwsgi_pass myupstream1;
      include /path/to/uwsgi_params;
  
      allow 127.0.0.1;
      deny all;
  }
  </code></pre>
  
  <p>When I try to visit /admin/ nginx responds with HTTP 403, but I want it respond with HTTP 404. Any recipe for this?</p>