I have some servers where I use an old method of gating a path by using a file 
check.

this allows staff to turn off certain locations during migrations/updates 
without having root privileges (needed to restart nginx)

an issue I noticed– this method now (perhaps always) shows the name of the 
location on the default 404 template [the response that nginx generates via 
code, not a template on the fs]

Does anyone know how to disable showing the location without defining a custom 
template on the filesystem?  or perhaps someone can think of a better way to 
accomplish my goals?



location /paths/to/ {
    if (!-f /etc/nginx/_flags/is_running) {
        rewrite ^.*$ @is_running break;
    }
}
location = @is_running {
    return 404;
}

=======
that generates this


        <html>
         <head>
          <title>404 Not Found</title>
         </head>
         <body>
          <h1>404 Not Found</h1>
          The resource could not be found.<br/><br/>
        /@is_running


         </body>
        </html>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to