Welcome! Log In Create A New Profile

Advanced

forced 404 without a location display ?

Jonathan Vanasco
July 11, 2016 03:28PM
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
Subject Author Posted

forced 404 without a location display ?

Jonathan Vanasco July 11, 2016 03:28PM

Re: forced 404 without a location display ?

Oleg A. Mamontov July 11, 2016 04:26PM

Re: forced 404 without a location display ?

Maxim Dounin July 11, 2016 04:30PM

Re: forced 404 without a location display ?

Jonathan Vanasco July 12, 2016 06:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready