Directory listing not working


#1

Hi

I need to be able to allow links to files in an upload directory on a Wordpress install. I have added the following into a .conf file in the conf/nginx directory in the site folder, but it does not work:

_location /var/www/example.com/htdocs/wp-content/uploads/filebase {_

_ autoindex on;_ _ }_

Any suggestions?


#2

You don’t need “_” around the config parameter. The syntax will be:

     autoindex on; }```

Just that should work.

#3

I don’t actually have the underscores - these were added by the Forum when I cut/paste.

So my syntax looks the same as what you suggest, but it just doesn’t work


#4

Add a tilde(~) after location. So that the new line looks like:

location ~ your/URL/path { autoindex on; }


#5

Sometimes you gotta edit your vhost file (ee site edit example.com) and move the line that includes your custom rules above other lines.

Note that any ee site update command will revert this edition, you’ll need to redo it.


#6

Thanks, guys. I’ve now tried all your suggestions, but keep getting a 403 error


#7