View Categories

Perfex CRM Nginx Configuration – Proven 10-Step Tutorial for Success

4 min read

Correct Perfex CRM Nginx configuration is essential to ensure smooth installation, secure operation, and optimal performance. Many users experience issues like 404 errors, blank pages, or PHP-FPM misconfigurations simply because their Nginx server block is not properly set up.

This proven 10-step tutorial will guide you through the complete process of setting up Perfex CRM on Nginx, from server requirements to caching and SSL integration.


Table of Contents #

  1. Why Use Nginx for Perfex CRM?
  2. Server Requirements Recap
  3. How to Setup Perfex CRM Nginx Configuration (Step-by-Step)
  4. Adding Rewrite Rules for Pretty URLs
  5. Perfex CRM Nginx Configuration with PHP-FPM
  6. Enabling SSL with Let’s Encrypt
  7. Adjusting File Permissions
  8. Optimizing Performance (Caching & Security)
  9. Common Errors and Fixes
  10. Troubleshooting Checklist
  11. FAQs

Why Use Nginx for Perfex CRM? #

Nginx is a lightweight, high-performance web server that excels at handling concurrent connections. When configured correctly, Perfex CRM Nginx configuration provides:

  • Faster page load times with PHP-FPM.
  • Improved scalability for teams with many users.
  • Efficient static file handling for invoices, images, and PDFs.
  • Easier SSL setup compared to Apache.

For businesses expecting growth, Nginx is often more future-proof than Apache.

📌 Related Doc: Perfex CRM Server Requirements


Server Requirements Recap #

Before configuring Nginx, verify your server meets the Perfex CRM Server Requirements:

  • PHP 8.1+ with extensions (mbstring, curl, gd, imap, openssl, json, xml, zip).
  • MySQL 5.7+ or MariaDB 10.3+.
  • At least 2GB RAM for VPS hosting.
  • Root access or sudo privileges.
  • DNS pointed to your server.

How to Setup Perfex CRM Nginx Configuration (Step-by-Step) #

Create a new server block for your domain:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    root /var/www/perfexcrm;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \\.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~* /\\.(htaccess|htpasswd|ini|phpsh|sql|bak|git|env) {
        deny all;
    }
}

Steps to enable:

  1. Save this as /etc/nginx/sites-available/perfex.conf.
  2. Enable it: ln -s /etc/nginx/sites-available/perfex.conf /etc/nginx/sites-enabled/
  3. Test configuration: nginx -t
  4. Restart Nginx: systemctl restart nginx

Adding Rewrite Rules for Pretty URLs #

Perfex CRM uses clean URLs. Without proper rewrites, you’ll hit the 404 Not Found error.

location / {
    try_files $uri $uri/ /index.php?$args;
}

This ensures all requests route to index.php.


Perfex CRM Nginx Configuration with PHP-FPM #

Nginx works with PHP-FPM for PHP processing. Make sure your PHP socket matches your version:

fastcgi_pass unix:/run/php/php8.1-fpm.sock;

Also optimize php.ini:

memory_limit = 512M
max_execution_time = 300
upload_max_filesize = 64M
post_max_size = 64M

Restart PHP-FPM:

systemctl restart php8.1-fpm

📌 External Resource: PHP-FPM Configuration Guide


Enabling SSL with Let’s Encrypt #

Security is critical. Install Certbot:

apt install certbot python3-certbot-nginx

Generate a free SSL certificate:

certbot --nginx -d yourdomain.com -d www.yourdomain.com

This automatically edits your Nginx config to redirect HTTP → HTTPS.


Adjusting File Permissions #

Perfex CRM requires write access for certain folders:

chown -R www-data:www-data /var/www/perfexcrm
chmod -R 755 /var/www/perfexcrm

Critical writable folders:

  • /application/config/
  • /uploads/

Optimizing Performance (Caching & Security) #

Improve speed with Gzip and caching:

gzip on;
gzip_types text/plain text/css application/json application/javascript;

location ~* \\.(jpg|jpeg|png|gif|ico|css|js)$ {
    expires 30d;
    access_log off;
}

Add security headers:

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;

For advanced setups, enable FastCGI caching to reduce PHP load.

📌 External Resource: Nginx Rewrite Documentation


Common Errors and Fixes #

  • 502 Bad Gateway → Wrong PHP-FPM socket.
  • 404 Not Found → Missing try_files directive.
  • Permission denied → Wrong ownership (chown).
  • SSL not working → Port 443 blocked in firewall.

Troubleshooting Checklist #

  • ✅ Correct server block created.
  • try_files directive added.
  • ✅ PHP-FPM configured properly.
  • ✅ SSL enabled with Certbot.
  • ✅ File permissions fixed.
  • ✅ Restarted Nginx & PHP-FPM.

If you ever face problems meeting these Perfex CRM server requirements, our team at Systematica is here to help. We provide expert support for installation, optimization, and custom module setup. Feel free to Contact Us Systematica Support

🔗 Ready to unlock mobility for your CRM? Get the Mobile App Module Now and experience Perfex on the move.

Leave a Reply
Clean & Secure Code

Built by professionals

Future-Proof and Scalable

with features planned

Dedicated Support

Our expert team is ready to help

100% Secure Checkout

PayPal / MasterCard / Visa