3

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

MrWhite
  • 12,647
  • 4
  • 29
  • 41
DavSev
  • 159
  • 1
  • 1
  • 5
  • 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. – Alexander Tolkachev 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 http://nginx.org/en/docs/http/ngx_http_autoindex_module.html. – DavSev Jul 12 '17 at 05:02
  • O.K, I found the configuration file at the `/etc/nginx/conf.d`directory. 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 05:50

1 Answers1

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;
}
DavSev
  • 159
  • 1
  • 1
  • 5