每个人。我有几个符号链接可以在单独的文件夹中登录。
drwxr-xr-x 2 root root 4096 Sep 28 14:00 .
drwxr-xr-x 4 root root 4096 Sep 28 12:34 ..
lrwxrwxrwx 1 root root 38 Sep 28 13:24 default.access.log -> /path/to/default/access/log
lrwxrwxrwx 1 root root 37 Sep 28 13:24 default.error.log -> /path/to/default/error/log
lrwxrwxrwx 1 root root 26 Sep 28 14:00 fpm.error.log -> /path/to/php/fpm/error/log
-rw-r--r-- 1 root root 50 Sep 28 13:50 .htpasswd
lrwxrwxrwx 1 root root 37 Sep 28 13:24 images.access.log -> /path/to/images/access/log;
lrwxrwxrwx 1 root root 36 Sep 28 13:24 images.error.log -> /path/to/images/error/log;
我想通过 url 查看这些文件。我的 nginx 配置:
server {
listen 80;
server_name servername;
root /path/to/root;
charset UTF-8;
access_log /path/to/access/log;
error_log /path/to/error/log;
location ~ \.htpasswd$ {
deny all;
}
location ~* \.log$ {
expires epoch;
log_not_found off;
add_header Content-Type text/plain;
auth_basic "Restricted";
auth_basic_user_file /path/to/htpasswd;
}
location / {
autoindex on;
auth_basic "Restricted";
auth_basic_user_file /path/to/htpasswd;
}
}
它工作正常,但我只看到四个文件:
default.access.log 28-Sep-2013 14:19 3431596
default.error.log 28-Sep-2013 13:40 728
images.access.log 28-Sep-2013 14:18 415324
images.error.log 28-Sep-2013 12:05 0
我的错误在哪里?提前致谢。