我有一个位于 的 WordPress 站点mysite.com/blog,其文件位于/var/www/mysite/wordpress. 为什么,当我访问 时mysite.com/blog/test,如果我$args从 中删除,我的嵌套位置块只会被击中try_files?
server {
server_name mysite.com;
location /blog {
alias /var/www/mysite/wordpress;
try_files $uri $uri/ /blog/index.php$args;
location ~ \.php {
# This is only reached if I remove $args from try_files
return 401; # For testing purposes
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是日志中的相关错误:
"/usr/share/nginx/html/index.php" failed (2: No such file or directory)