george-alexander Posted February 12, 2020 Share Posted February 12, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
Villavu Posted February 16, 2020 Share Posted February 16, 2020 (edited) Hey! Yes I have managed to get it to work with nginx, I suspect that you followed this tutorial? https://hostup.org/blog/whmcs-friendly-urls-configuration-for-nginx/. Well, I actually wrote it with some help of others. Anyways, I haven't tried it with plesk, only on actual linux nginx on ubuntu and debian. It is strange that you are getting database connection errors as it shouldn't touch that part? I would recommend doing it like I have done on my whmcs installation. 1. https://hostup.org/blog/how-to-install-nginx-and-php-7-3-on-debian-10/ 2. install whmcs 3. follow the above whmcs friendly urls configuration for nginx. Edited February 16, 2020 by Villavu 0 Quote Link to comment Share on other sites More sharing options...
kang28ivan Posted February 17, 2020 Share Posted February 17, 2020 I also use nginx long time ago but on vestacp and it works well by adding templates to vestacp. 0 Quote Link to comment Share on other sites More sharing options...
Alliance Posted June 23, 2022 Share Posted June 23, 2022 Can you share these templates please? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.