How To Configure Nginx for SugarCRM

1. Introduction

For various needs you may need to use nginx as a component Web Server for the installation of SugarCRM as a replacement for Apache or IIS . SugarCRM not reported (see Supported SugarCRM Platform ) nginx as a component supported by your platform, this results in losing the support for installation (of course on trade issues) SugarCRM on this Web Server and going to surely encounter configuration problems.

The Web Server nginx is recommended by SugarCRM in configurations that require high scalability, entrusting this responsibility to Load Balancer servers with instances of SugarCRM are always based on the Apache Web Server. For further information on this topic please refer to the document SugarCRM Scalability and Performance Benchmarks .

2. Configuring Nginx

Up to version 6.5 (both Community Edition is Commercial Edition), the default configuration setting in nginx LEMP (Linux, nginx, MySQL , and PHP) is more than enough to install and run SugarCRM smoothly apparent.

From the new version of SugarCRM 7 introduces several features based on RESTful servicesthat would make the correct configuration of the web server an important factor for the success of the installation and execution of SugarCRM.

The key word in the correct configuration . htaccess . What does it mean? On the file. htaccess rewrite rules are given (or url rewrite ) the URL for the RESTful services SugarCRM. From version 7 of SugarCRM, even the GUI (code-named Sugar UX ® ) heavily uses the RESTful services, therefore, the wrong nginx configuration involves the malfunction of SugarCRM. Figure 1 shows an example of SugarCRM does not work even if the installation is successful.

Figura 1 - Errore durante il caricamento dell'applicazione
Figure 1 – An error occurred while loading the application

The highlighted error could fool with the http 404 error, tends to think of a installation error, on the contrary, indicates a wrong (I would say absent) url rewrite configuration. In fact, the URL that the browser tries to request points to a RESTful service but the misconfiguration causes an error to access the resource with a HTTP code 404.

Listing 1 shows. htaccess file (created during installation of SugarCRM) with out the sun rules regarding RESTful services.

The solution for a proper configuration of nginx is to transform the rules set out in the .htaccess file in nginx rules. Unfortunately nginx does not support htaccess and Apache syntax for the url rewrite, the conversion task is then to be done manually. At Listing 2 shows the url rewrite rules nginx converted format.

Once the revised configuration of nginx with rewrite rules url SugarCRM should work correctly including the RESTful services.

3. Conclusions

I wrote this short post as a response to this topic:

  • guest: Why SugarCRM 7.1 does not work, does not even show the login page?
  • amusarra: Strange, what version of Apache and PHP has been installed?
  • guest: On nginx and PHP 5.3
  • amusarra: Well, then chances are it will not work …..

To experience is always good thing to respect the indications on the stack software (and possibly hardware) manufacturer, even more so if it comes to commercial products.

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC ( bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

You may also like...

Cos'è il progetto CIE/CNS Apache Docker - Developers Italia

In questo video introdurrò il progetto CIE/CNS Apache Docker di Developers Italia ( nato circa due anni fa.

L'obiettivo di questo progetto è quello di fornire un template pronto all'uso che realizza un sistema di autenticazione tramite la Smart Card TS-CNS (o CNS) e la CIE (Carta d'Identità Elettronica) basato su Apache HTTP. Ognuno può poi modificare o specializzare questo progetto sulla base delle proprie esigenze Si tratta di un progetto docker per la creazione di un container che implementa un sistema di mutua autenticazione o autenticazione bilaterale SSL/TLS.

Questo meccanismo di autenticazione richiede anche il certificato digitale da parte del client, certificato che in questo caso risiede all'interno della TS-CNS o della CIE. La particolarità del sistema implementato (attraverso questo container) è quella di consentire l'autenticazione tramite:

  • La TS-CNS (Tessera Sanitaria - Carta Nazionale Servizi), rilasciata dalla regione di appartenenza;
  • La CIE (Carta d'Identità Elettronica), rilasciata dal comune di residenza.

Nella versione 2.0.0 il progetto è stato aggiornato per essere uniforme alle linee guida di Bootstrap Italia. A seguire alcune risorse che possono essere utili.

  • Cos’è il progetto CIE/CNS Apache Docker (
  • CIE Carta d'Identità Elettronica (
  • Carta Nazionale dei Servizi (
  • Raspberry Pi – Un esempio di applicazione della TS-CNS (
  • Pubblicare il servizio CIE/CNS Apache Docker su Azure Cloud (
  • Come accedere al portale VETINFO tramite TS-CNS e Mac OS (