1
我試圖打開索引只是我的內部IP範圍。nginx autoindex僅適用於內部IP地址
,我迄今已檢測的一些事情:
geo $internals {
default 0;
192.168.2.0/24 1;
}
location/{
# Attempt 1, same error message.
if ($internals) {
autoindex on;
}
# Attempt 2, same error message.
if ($remote_addr = "192.168.2.[2|254]") {
autoindex on;
}
try_files $uri $uri/ /index.php;
}
無論我嘗試,我總是得到:
Restarting nginx: nginx: [emerg] "autoindex" directive is not allowed here in ...