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

Did anyone in the universe make this work with Nginx?


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

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


2 Answers

Hi Jack

Can't add comments yet but the simpler rules using try_files without the rewrites listed at 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 - - 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.


answered October 31, 2013 at 8:22 AM
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;
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
answered September 20, 2013 at 8:29 PM

Your answer

Join with account you already have