Wednesday, 19 September 2012

Zencart on NGINX: Cannot Login to Admin

This week, we're set up a new server with Ubuntu 12.04 and NGINX. When we put a copy of Zencart on it, everything was great apart from teh admin login, which went into an 'infinite loop' and refused to log us in.

The solution was simple to do, although desperately hard to find - hence its appearence here:

Login to the server as root and edit the /etc/nginx/fastcgi_params file:

Simply comment out (add # at the beginning of the line) to the line that says:

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

Now restart nginx and you're done!

[UPDATE: you may need to check the lines in your configure.php file from the admin directory - they need to point correctly, without using the PHP_SCRIPT line:


  define('DIR_WS_ADMIN', '/#your admin folder#/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_ADMIN', '/#your admin folder#/');