Uncorrupted Blog

Get the inside scoop from us dirrectly from our own blog

OCT6

WHMCS Rewrite Rules for Nginx

by Uncorrupted-Michael

nginx_logo
WHMCS is a very popular client management package with a slew of billing, support, and product management options. We use it here and have just recently moved our WHMCS site over to an nginx powered web server. The rewrites have all been worked out and since there’s nothing to be found on the subject via google we decided to share. :)

server {
            listen   80;
            server_name  my.uncorrupted.net;
            rewrite ^/(.*) https://my.uncorrupted.net/$1 permanent;
       }

server {
            listen   443;
            server_name my.uncorrupted.net;
            access_log /xxx/xxx/xxx/logs/access.log;
            error_log /xxx/xxx/xxx/logs/error.log;
	    	ssl on;
	    	ssl_certificate /xxx/xxx/xxx/.ssl/cert.pem;
	    	ssl_certificate_key /xxx/xxx/xxx/.ssl/key.pem;

            location /  {
                        root   /xxx/xxx/xxx/public_html/;
                        index  index.html index.php;
		    }

			location = /announcements {
        				rewrite ^  /announcements.php  last;
    		}

    		location /announcements/ {
        				rewrite  ^/announcements/([0-9]+)/[A-Za-z0-9_-]+\.html$ /announcements.php?id=$1 last;
    		}

    		location = /downloads {
        				rewrite ^  /downloads.php  last;
    		}

    		location /downloads/ {
        				rewrite ^/downloads/([0-9]+)/([^/]*)$ /downloads.php?action=displaycat&catid=$1 last;
    		}
			location = /knowledgebase {
       					rewrite ^  /knowledgebase.php  last;
    		}
			location /knowledgebase/ {
        				rewrite  ^/knowledgebase/([0-9]+)/[A-Za-z0-9_-]+\.html$ /knowledgebase.php?action=displayarticle&id=$1 last;
        				rewrite  ^/knowledgebase/([0-9]+)/([^/]*)$ /knowledgebase.php?action=displaycat&catid=$1 last;
    		}

            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            location ~ \.php$ {
            			fastcgi_pass 127.0.0.1:9000;
            			fastcgi_index index.php;
            			include /usr/local/nginx/conf/fastcgi_params;
            			fastcgi_param SCRIPT_FILENAME /xxx/xxx/xxx/public_html/$fastcgi_script_name;
            }
}

Gest of luck – if you run into any issues write us a comment and we’ll see if we can help you work it out.

Grab Our Button

Uncorrupted Hosting - High Performance Managed VPSs

Testimonials

  • testimonial Amy from Amy Loves it says:

    The assistance Uncorrupted has provided me has been priceless. My website would not be what it is without their service.

  • DealSeekingMom.com Testimonial Tara from Deal Seeking Mom says:

    The service that Uncorrupted provides just does not even compare to other hosting companies. I feel secure in knowing that my site is in excellent hands, and I greatly appreciate the personal attention I receive when I need assistance with the technical aspects of my site.

  • couponing101.com testimonial Stephanie from Couponing 101 says:

    Uncorrupted has far exceeded my hosting expectations! You cannot find a more knowledgeable, helpful, and reliable hosting service anywhere else! The tech support provided is invaluable! You won’t be disappointed with Uncorrupted!

  • FaithfulProvisions.com Testimonial Kelly from Faithful Provisions says:

    I have been with a few other hosting providers and NONE even compared to the service I have received with Michael and Uncorrupted. I promise you, you won’t find service like this anywhere.

More Testimonials
compassion

We're loyal donators to Compassion International, a Christian child advocacy ministry that releases children from spiritual, economic, social and physical poverty and enables them to become responsible, fulfilled Christian adults.





Copyright © 2010 Uncorrupted Hosting. All rights reserved. Follow us on TwitterBe our Facebook Fan
Latest Blog Post:

Playing with snort and pfSense

We've been having a blast with some new intel atom based pfSense firewalls here in the office. The d510 boards perform amazingly well, even with a slew of snort...


Visit our Blog