
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.


Amy from
Tara from
Stephanie from
Kelly from