Jump to content

WHMCS NGINX Rewrite Rules for Version 8.1.3


JayV

Recommended Posts

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 by JayV
Link to comment
Share on other sites

  • 11 months later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated