规则来自于whmcs官方说明:http://docs.whmcs.com/Support_Center

支持whmcs 6.x 亲测在6.3.1上有效。

WHMCS NGINX web server rewrite rules
# Announcements
rewrite ^/announcements/([0-9]+)/[a-zA-Z0-9-]+\.html$ /./announcements.php?id=$1 last;
rewrite ^/announcements$ /./announcements.php last;
 
# Downloads
rewrite ^/downloads/([0-9]+)/([^/]*)$ /./downloads.php?action=displaycat&catid=$1 last;
rewrite ^/downloads$ /./downloads.php last;
 
#Knowledgebase
rewrite ^/knowledgebase/([0-9]+)/[a-zA-Z0-9-]+\.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
rewrite ^/knowledgebase/([0-9]+)/([^/]*)$ /./knowledgebase.php?action=displaycat&catid=$1 last;
rewrite ^/knowledgebase$ /./knowledgebase.php last;

# 防止tpl inc cfg文件被下载
location ~* \.(tpl|inc|cfg)$ {
deny all;}