【发布时间】:2017-07-09 15:05:19
【问题描述】:
我在 Nginx 上有一个带有子域的 WordPress 多站点设置。
我想上传这样的网址来工作...
http://mysub.mydomain.com/files/2017/07/myfile.png
文件的位置在哪里...
<web root>/wp-content/uploads/sites/xx/2017/07/myfile.png
这是 Nginx 配置中的位置规则:
location ~ ^/files/(.*)$ {
try_files /wp-content/uploads/sites/$blogid/$1;
access_log off; log_not_found off; expires max;
}
它不起作用,我不明白为什么。
我也尝试过(以及许多变体):
location ^~ /files {
internal;
alias /www/wp-content/uploads/sites/$blogid;
access_log off; log_not_found off; expires max;
}
如果其中任何一个可以被确认为“应该工作”,那么我将开始查看我的代码中可能优先考虑的更高规则(尽管我还没有跳出来)...
【问题讨论】: