I have a server configured as a reverse proxy to my server. I want to reject all the requests except to two locations, one for root and another the api root.
so the server should only allow requests to the given paths
example.com/ (only the root)
example.com/api/ (every url after the api root)
The expected behaviour is that the server should reject all the below possibilities.
example.com/location
example.com/location/sublocation
example.com/dynamic-location
my current nginx configuration,
server {
# server configurations
location / {
# reverse proxy configurations
}
}
How do I set up this configuration?