2

I have a WordPress site on a LAMP server (CentOS 7). In the WordPress root folder I added a folder called minisite.

www.example.com/minisite/file.html

While trying to access the minisite directory from the browser I get a 403 error.

How can I allow the access to the minisite directory?

I read the following question but the answer wasn't very clear to me. Also, I couldn't figure out in what file the changes are made. Nginx - Allow access to folder directory only by referring URL

4
  • Are you literally trying to access the bare directory, eg. /minisite/ (as stated), or a file in that directory, eg. /minisite/file.html, as in your example URL?
    – MrWhite
    Jul 11 '17 at 13:33
  • Please provide nginx config. Jul 11 '17 at 20:42
  • I try to access the /minisite/file.html file only. In which file can I find the nginx configuration? I found this link but I dont know where to add the code nginx.org/en/docs/http/ngx_http_autoindex_module.html.
    – DavSev
    Jul 12 '17 at 5:02
  • O.K, I found the configuration file at the /etc/nginx/conf.ddirectory. I added this block to the file : location /minisite/ { autoindex on; } now I can access the directory but I see a list of files in it. how can I auto load the index.html file that is in the minisite directory
    – DavSev
    Jul 12 '17 at 5:50
2

O.k first I had to find the configuration file. I found it in the /etc/nginx/conf.d directory.

Than I cane across this tutorial: http://nginx.org/en/docs/http/ngx_http_autoindex_module.html

I added this block inside the server block:

location /srita/ {
index index.html;
autoindex on;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.