I kept getting "directory forbidden error" on image directory /images/upload.
By adding autoindex on that directory, I can remove this error. But I don't want people to see what are under that directory.
How do I remove this error?
Nginx config
server
{
listen 80;
server_name www.no-dev.com;
index index.php index.html index.htm;
root /opt/www/no_web;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
#location /images {
# autoindex on;
#}
location ~* \.(css|js)$ {
add_header Last-Modified: $date_gmt;
expires 1y;
access_log off;
}
location ~* \.(jpg|jpeg|gif|png|ico|bmp|swf)$ {
expires max;
access_log off;
}
access_log logs/no-dev.log main;
}