Username
Forgot password?
Welcome to our site!
Or Join with FTTF

Did anyone in the universe make this work with Nginx?

0

840 views
Hi, this question is for all sentient life in the universe, has anyone successfully made this work with nginx?

I tried the config file from here http://support.lampcms.com/viewq...rules-for-nginx

I spent 12hrs trying to make this work with nginx, my back hurts from sitting so long and I feel like jumping from a high building
 
asked September 19, 2013 at 9:42 PM

 us

2 Answers

0
 
Hi Jack

Can't add comments yet but the simpler rules using try_files without the rewrites listed at http://support.lampcms.com/viewq...rules-for-nginx works and is far more maintainable. It simply passes through the path info to the index.php front controller.

There is a variation on this that also works for me with an installation in / but drew1two's config works just as well.


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



cgi.fix_pathinfo is on in PHP configuration, with the NginX->FPM connection via a socket for me, that being the only difference to the config provided in the 1st answer.

If you want to know more about try_files, check up here - http://wiki.nginx.org/HttpCoreModule#try_files - in short "Checks for the existence of files in order, and returns the first file that is found"

Example: If you loaded up your lampcms install /robots.txt the request would be handled by NginX and not passed to PHP as that file exists on disk.

Regards

flag
answered October 31, 2013 at 8:22 AM
1
 
Hi Jack,
Yes it works with nginx pretty much straight out of the box. ie:- no re-write rules needed. Though LampCMS does not work from a sub-directory at all, even though 'some' provisions were made for it to do so. It obviously wasn't tested in this configuration cause it errors (don't ask me what exactly now, to long ago), but can only be implemented as a sub-domain instead.

My conf looks like this:-

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

location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}

I'm using TCP\IP connection instead of unix socket due to 502 errors when socket is under load.

Hope this helps
flag
answered September 20, 2013 at 8:29 PM

Your answer

Join with account you already have

FTTF

Preview

Alert