Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup an nginx server to allow requests from a single IP and as well internal requests. The reason being that this box could be hit directly, or via a proxy_pass. I haven't been able to find a way to mix allow AND internal. In an ideal world I'd like to do something like this:

   location = /myFile.html {
         # allow to permit proxy_pass from other box
         allow XX.X.X.XX;
         # allow internal requests
         # deny everything else
         deny all;

I've read through the documentation, and haven't been able to find the right combination of directives to allow for this.

share|improve this question

migrated from Sep 12 '11 at 21:48

This question came from our site for professional and enthusiast programmers.

internal location will accept requests from rewrite, try_files, etc. and SSI requests (they are considered internal in the scope of primary outer request)

share|improve this answer

The internal directive is to restrict access only to internal request and it is not possible to use it in conjunction with allow. Instead of using internal, why don't you use allow ?

internal indicates that the matching location can be used only for so called "internal" requests.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.