JayV Posted April 19, 2021 Share Posted April 19, 2021 (edited) My friend Bala gave me a hand with these rules for nginx. #== WHMCS Security Advisory 2020-01-28 location ^~ /whmcs/vendor/ { deny all; return 403; } #== WHMCS Admin Area location ~ /whmcs/admin/(client!\.php|client/(.*)|search!\.php|search/(.*)|apps|billing|setup|user|services|addons|domains|utilities|logs|help!\.php|help/license|image/(recent|upload))/?(.*)$ { root /path/to/website/root/folder; rewrite ^/(.*)$ /whmcs/admin/index.php?rp=/admin/$1/$2; } #== WHMCS Client Area location ~ /whmcs/(images/em|invoice|login|password|account|store|download|knowledgebase|project_management|announcements|clientarea/ssl-certificates|user/(verification|accounts|profile|password|security|verify)|cart/(domain/renew)|cart/order|images/kb)/?(.*)$ { root /path/to/website/root/folder; rewrite ^/(.*)$ /whmcs/index.php?rp=/$1/$2; } Finish the task by completing the following: 1. Log in to your WHMCS Admin 2. Go to Configuration > General and change your "Friendly URLs" to "Full Friendly Rewrite" 3. Go to Utilities > System > System Cleanup > Empty Template Cache 4. Clear your cache at /var/cache/nginx/* 5. Test Nginx with "nginx -t" 6. Reload Nginx with "nginx -s reload" I hope this helps someone. Cheers! Edited April 19, 2021 by JayV 0 Quote Link to comment Share on other sites More sharing options...
mcpacific Posted March 24, 2022 Share Posted March 24, 2022 Apparently the "Login as Owner" function will not work with NGINX. Support is no help. Have you found a solution for that? 0 Quote Link to comment Share on other sites More sharing options...
Alliance Posted June 24, 2022 Share Posted June 24, 2022 Did you find any solution? 0 Quote Link to comment Share on other sites More sharing options...
xyzulu Posted July 10, 2023 Share Posted July 10, 2023 For client login, just add something like: location ~ /whmcs/admin/client/?(.*)/login/?(.*)$ { rewrite ^/(.*)$ /whmcs/admin/index.php?rp=/client/?(.*)/login/$1; } 0 Quote Link to comment Share on other sites More sharing options...
xyzulu Posted July 11, 2023 Share Posted July 11, 2023 I've dug into this subject, with a little help from here: Just in case more people search for this, I have also updated and provided a "vanilla" list of the nginx rules required here: https://gist.github.com/xyzulu/dbe2762c131b7bf3fbfc67056a565ae0 It would be good for WHMCS to support Nginx better.. a simple list of these rules in the documentation would be enough.. but anyway. 0 Quote Link to comment Share on other sites More sharing options...
lulzkiller Posted July 14, 2023 Share Posted July 14, 2023 On 7/12/2023 at 12:20 AM, xyzulu said: I've dug into this subject, with a little help from here: Just in case more people search for this, I have also updated and provided a "vanilla" list of the nginx rules required here: https://gist.github.com/xyzulu/dbe2762c131b7bf3fbfc67056a565ae0 It would be good for WHMCS to support Nginx better.. a simple list of these rules in the documentation would be enough.. but anyway. Hey, thanks for that. How would you edit this if your WHMCS installation resides in public html, and not in client or any folder sub folder. 0 Quote Link to comment Share on other sites More sharing options...
xyzulu Posted July 14, 2023 Share Posted July 14, 2023 10 hours ago, lulzkiller said: How would you edit this if your WHMCS installation resides in public html, and not in client or any folder sub folder. /clients.. /admin.. Just remove the '/clients' from the start of the rewrite directives 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.