Hello guys,
I am truggling to use whmcs with nginx. I'm using a plesk server environment and I disabled the proxy mode, so nginx was running.
I managed to do the right config for the first site on the domain, a wordpress one.
I have whmcs installed in /hosting folder on domain and I tried these:
location ~ /hosting/announcements/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/announcements/$1;
}
location ~ /hosting/download/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/download$1;
}
location ~ /hosting/knowledgebase/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/knowledgebase/$1;
}
location ~ /hosting/store/ssl-certificates/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/store/ssl-certificates/$1;
}
location ~ /hosting/store/sitelock/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/store/sitelock/$1;
}
location ~ /hosting/store/website-builder/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/store/website-builder/$1;
}
location ~ /hosting/store/order/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/store/order/$1;
}
location ~ /hosting/cart/domain/renew/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/cart/domain/renew$1;
}
location ~ /hosting/account/paymentmethods/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/account/paymentmethods$1;
}
location ~ /hosting/password/reset/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/password/reset/$1;
}
location ~ /hosting/account/security/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/account/security$1;
}
location ~ /hosting/subscription?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=/subscription$1;
}
#Social media authorization
location ~ /hosting/auth/provider/google_signin/finalize/?(.*)$ {
rewrite ^/(.*)$ /hosting/index.php?rp=auth/provider/google_signin/finalize$1;
}
#WHMCS ADMIN
location ~ /hosting/admin/(addons|apps|search|domains|help\/license|services|setup|utilities\/system\/php-compat)(.*) {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/admin/$1$2 last;
}
location ~ /hosting/admin/client/?(.*)/paymethods/?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/client/?(.*)/paymethods/$1;
}
location ~ /hosting/admin/setup/auth/?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/setup/auth/$1;
}
location ~ /hosting/admin/client/?(.*)/tickets/?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/client/?(.*)/tickets/$1;
}
location ~ /hosting/admin/client/?(.*)/invoice/?(.*)/capture/?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/client/?(.*)/invoice/?(.*)/capture/$1;
}
location ~ /hosting/admin/account/security/two-factor/?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/admin/account/security/two-factor/$1;
}
location ~ /hosting/admin/search/intellisearch?(.*)$ {
rewrite ^/(.*)$ /hosting/admin/index.php?rp=/search/intellisearch/$1;
}
# Security Advisory 2020-01-28
location ^~ /vendor/ {
deny all;
return 403;
}
# END WHMCS CONFIG
It's not working, it get an error that it cannot connect to the database.
The connection details are ok because when I use it with apache it works.
Is there anybody that managed to make whmcs work with nginx?
I want to do this switch because nginx is way faster.