Blocking all the URL except 1

Edho Arief me at myconan.net
Thu Jun 23 16:49:32 UTC 2016


Hi,

On Fri, Jun 24, 2016, at 01:47, Zeal Vora wrote:
> Hi
> 
> We have a Nginx Box which acts as a reverse proxy to backend
> applications.
> 
> We only want to allow traffic on http://example.com which internally
> redirects to specific application. Other then that, every other URI
> should
> be blocked.
> 
> For example :-
> 
> example.com            Allowed
> example.com/test     Blocked
> example.com/login    Blocked
> 
> How can I achieve this ?
> 


does this work?

location = / {
  return 302 https://...
}

location / {
  return 404;
}



More information about the nginx mailing list