nginx priority for rewrite and access restriction

kay nginx-forum at
Tue May 27 12:19:32 UTC 2014

I would like to enable /123 location only for locahost, but it doesn't work,
nginx return 302 redirect with header. It seems rewrite directive has higher
priority than access module.

    location /123 {
                satisfy all;
                deny    all;
                add_header Set-Cookie "cookie=123; Domain=localhost";
                rewrite ^ / redirect;

How to restrict access for /123 location without "if"?

Posted at Nginx Forum:,250391,250391#msg-250391

More information about the nginx mailing list