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...