我安装了mediawiki.一切正常,除了我尝试为外部目录命名(Webalizer Web统计信息)时.我看到Nginx将请求传递给/ usage / *到PHP / Mediawiki.我不要我真的希望/ usage /下的所有内容都指向我的别名,而没有别的.与Mediawiki代码和功能完全分开.
# in no way related to Mediawiki. I just want to serve this as static HTML.
location /usage {
alias /var/www/webalizer/wiki.longnow.org/;
}
# This answers to anything,which may be my problem
location / {
try_files $uri $uri/ @rewrite;
index index.PHP;
}
# A special rewrite to play nicely with Mediawiki
location @rewrite {
rewrite ^/(.*)$/index.PHP?title=$1&$args;
}
# PHP,nom nom nom
location ~ \.PHP${
include fastcgi_params;
fastcgi_index index.PHP;
fastcgi_pass unix:/tmp/PHP-fastcgi.socket;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
我希望在其余命令之前列出/ usage location指令会使系统短路,但我对Django颇为宠爱;)
最佳答案
原文链接:https://www.f2er.com/nginx/532223.html