Elxis CMS Forum

Support => Installation => Topic started by: Takeshi on December 12, 2015, 18:14:19

Title: Nginx configuration
Post by: Takeshi on December 12, 2015, 18:14:19
I installed Elxis 4.3 on an Apache Server, it works fine. Now I have to install it on a Ngix Server and it doesn't work, the admin have no idea why how to config the server. He told me he used the htacces for mor information.

There are to ways to transmit variables:
- index.php?var0=value0&var1=value1
- index.php/value0/value1

Both ways work, but the combination doesn't. So a link like "http://site.de/estia/index.php/content/articles/" works, but "http://site.de/estia/index.php/content/articles/edit.html?id=20" doesn't.

He requested me to ask what to do. Is there a sample config for nginx? Thanks!
Title: Re: Nginx configuration
Post by: Takeshi on December 14, 2015, 20:27:22
Is there nobody who use elxis with nginx server?
Title: Re: Nginx configuration
Post by: webgift on January 05, 2016, 09:11:19
Hello Takeshi,
As you can realize it is hard to send you a certain guidelines for Nginx server without checking
this out in action. I don't know if you have already found out a solution however if you are still
interested please send me a private message with access of your elxis installation.

Wish you a very great year and welcome to Elxis CMS.
Title: Re: Nginx configuration
Post by: gmelis on February 01, 2016, 09:02:37
Try something like this:

Code: [Select]
location ~ .+$ {
  rewrite ^/(.*) /index.php?$1;
  try_files /3d7420fdffab12de0f08196d1a03256c.htm @php;
}

I suppose you already have a "location @php" directive, of course.

To expand a bit, when using nginx you don't have access to something like mod_php as in apache. You will have to make use of php-fpm, which btw is the suggested method for apache and all other web servers, too (much faster than mod_php). I won't elaborate here in the php-fpm part of the setup (suffice it to say that you have to spend some time reading), but I'll paste below a "location @php" example from one of the sites I support.

Code: [Select]
        location @php {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/web3.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }

It may seem daunting at first, but by making good use of includes it can become very stylish.

Feel free to contact me if nothing works.