首页 > 解决方案 > Whmcs 友好的 URL 设置不适用于 nginx。我怎样才能解决这个问题?

问题描述

我正在尝试在 whmcs 上设置完整的友好 url,但我无法使配置正常工作。我尝试了各种配置,但似乎都不起作用,而那些起作用的配置会破坏其他东西,例如管理员 URL。

https://whmcs.community/topic/291496-moderncurrent-76-nginx-rules/ 我试过这个,但它不适用于所有 URL

标签: whmcsnginx-config

解决方案


试试这些配置

    location ~ /billing/announcements/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/announcements/$1;
}

location ~ /billing/downloads/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/downloads/$1;
}

location ~ /billing/knowledgebase/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/knowledgebase/$1;
}

location ~ /billing/store/ssl-certificates/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/ssl-certificates/$1;
}

location ~ /billing/store/sitelock/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/sitelock/$1;
}

location ~ /billing/store/website-builder/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/website-builder/$1;
}

location ~ /billing/store/order/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/order/$1;
}

location ~ /billing/download/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/download$1;
}

location ~ /billing/cart/domain/renew/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/cart/domain/renew$1;

}

location ~ /billing/knowledgebase/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/knowledgebase/$1;
}

location ~ /billing/store/ssl-certificates/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/ssl-certificates/$1;
}

location ~ /billing/store/sitelock/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/sitelock/$1;
}

location ~ /billing/store/website-builder/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/website-builder/$1;
}

location ~ /billing/store/order/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/store/order/$1;
}

location ~ /billing/download/?(.*)$ {
    rewrite ^/(.*)$ /billing/index.php?rp=/download$1;
}

location ~ /billing/admin/setup/authn/view/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/authn/view/$1;
}

location ~ /billing/admin/apps/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/apps$1;
}

location ~ /billing/admin/setup/notifications/overview/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/notifications/overview$1;
}

location ~ /billing/admin/setup/storage/index/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/storage/index$1;
}

location ~ /billing/admin/setup/payments/tax/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup/payments/tax$1;
}

location ~ /billing/admin/help/license/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/help/license$1;
}

location ~ /billing/admin/setup/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/setup$1;
}
location ~ /billing/admin/utilities/system/php-compat/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/utilities/system/php-compat$1;
}

location ~ /billing/admin/services/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services$1;
}

location ~ /billing/admin/services/shared/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/shared$1;
}

location ~ /billing/admin/services/reseller/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/reseller$1;
}

location ~ /billing/admin/services/server/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/server$1;
}

location ~ /billing/admin/services/other/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/services/other$1;
}

location ~ /billing/admin/addons/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/addons$1;
}

location ~ /billing/admin/domains/?(.*)$ {
    rewrite ^/(.*)$ /billing/admin/index.php?rp=/admin/domains$1;
}

参考


推荐阅读