ScaleScaleScaleScale

Tips / Nginx


Pimcore Nginx Configuration

Pimcore is not just a simple CMS like Joomla or WordPress. It’s a whole new concept of CMS. To begin with, it’s free and open-source, making it available for a lot of people around the world.

Right now, Pimcore is powering more than 65K websites. You can also use Pimcore as a web content management platform, though it’s much more than that. Pimcore has been written in PHP, Zend Framework and MySQL. All of its code is under the BSD license.

Pimcore integrates various applications like e-commerce, digital asset management, marketing management and more. It’s also an engagement management platform and is often used for customer experience management (CEM).

You should already have Nginx installed, and PHP should be running with the PHP-FPM daemon. If not, use these links to get started on that:

This tutorial link will give you an idea about how to setup the PHP-FPM daemon to run with Nginx:

Once you have Nginx running with PHP-FPM, you should have no trouble using the following Pimcore configuration for Nginx.

Pimcore Nginx Configuration

Here, you will learn how to configure this fantastic piece of software on Nginx.

Create a virtual host file for your site, like this example:

nano -w /etc/nginx/conf.d/yoursite.com.conf

Paste this configuration inside:

server {
server_name yoursite.com www.yoursite.com;
listen 80;
root /var/www/yoursite.com;
index index.php index.html index.htm;


### Needed for Assets delivery
location ~* ^/website/var/assets {
try_files $uri $uri/;
}


### Access to Pimcore Plugins
location ~* ^/plugins/(.*)/static {
try_files $uri $uri/;
}


### Access to core assets
location ~* ^/pimcore/static {
try_files $uri $uri/;
}


### Protect Pimcore Configuration Files
location ~* ^/website/var/(tmp|assets|plugins|areas) {
deny all;
}
location ~* ^/(plugins|pimcore) {
deny all;
}


### Root location
location / {
## Pimcore rewrite rules, redirect request to index.php
try_files $uri $uri/ /index.php$is_args$args;
}


### PHP-FPM using sockets will parse PHP files
location ~ .php$ {
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_split_path_info ^(.+.php)(.*)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}

Save it, and reload Nginx to apply the changes:

service nginx reload

If you haven’t tried Pimcore yet, visit their website.

What do you think about Pimcore? Were you able to get it to work on Nginx? 

Popular search terms:

  • https://www scalescale com/tips/nginx/pimcore-nginx-configuration/
  • pimcore maxcdn
profile

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking

  • Michel Renard

    Hello, and for version 5, there is a good configuration for Nginx?