I am new to Webserver configurations etc.
My question is how can I write a rule for a root directory and all the content to that if someone tries directly a not authorised error appears.
eg in the picture prevent access to ajax and all thats contained
CodePudding user response:
the config below will take care of this: (it is considered that the directory ajax is located in root directory you defined in your nginx config, otherwise you have to specify full address of your ajax directory relative to your root directory.)
location ~* /ajax/* {
return 403;
}