NGINX Configuration for cs-cart

location / {



index index.php;



if (-f $request_filename) {

break;

}



if (-d $request_filename) {

break;

}



rewrite ^ /index.php?sef_rewrite=1;



try_files $uri $uri/ /index.php?sef_rewrite=1;



}





and this is not working :|


location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite ^ /index.php?sef_rewrite=1;
}
}
location ~* .(tpl|zip|gz)$ {
if (-f $request_filename) {
return 403;
}
}

[size=4][color=#333333][font=arial, sans-serif]I [/font][/color][color=#333333][font=arial, sans-serif]error [/font][/color][color=#333333][font=arial, sans-serif]out[/font][/color][color=#333333][font=arial, sans-serif]:[/font][/color]

[color=#333333][font=arial, sans-serif]Home Page[/font][/color][color=#333333][font=arial, sans-serif]- 403[/font][/color]

[color=#333333][font=arial, sans-serif]admin.php -[/font][/color][color=#333333][font=arial, sans-serif]500[/font][/color][/size]



[size=4][color=#666666][error] 4050#0: *7624 rewrite or internal redirection cycle while processing “/index.php”, client: …, server: f…, request: “GET /admin.php HTTP/1.1”, host: “…”[/color][/size]

Check this site it may help get the rewrites working [url=“http://www.anilcetin.com/convert-apache-htaccess-to-nginx/”]http://www.anilcetin.com/convert-apache-htaccess-to-nginx/[/url] also their english mailing list forum is very helpful [url=“Nginx Forum :: Nginx Mailing List - English”]Nginx Forum :: Nginx Mailing List - English

Isn't NGINX just an HTTP SERVER replacement? Is anyone using it and seeing better performance than with Apache?

NGinx is a high performance webserver (HTTP / HTTPS) with very small memory footprint compared to Apache (code bloated, high memory footprint). NGinx also has some nice features which give it an edge when serving static content, including serving pre-gzipped files if they are available.



Two configuration options for using NGinx with CS-Cart:


  1. NGinx (Serving Static) + FastCGI PHP
  2. NGinx (Serving Static) + Apache Backend PHP



    If you have limited server memory then NGinx will improve server performance when compared with Apache

so if i have a vps with 2048 megs of ram and cpanel do you think i would benefit from NGinx?

[quote name='solesurvivor' timestamp='1325256689' post='128687']

Isn't NGINX just an HTTP SERVER replacement? Is anyone using it and seeing better performance than with Apache?

[/quote]



Sure it's a “replacement” Zappos, Facebook and many others have replaced apache with nginx, it's become more popular than IIS, [url=“Nginx overtakes Microsoft as No. 2 Web server | InfoWorld”]http://www.infoworld.com/t/application-servers/nginx-overtakes-microsoft-no-2-web-server-183079[/url]



If you configure your VPS correctly you'll see the performance increase. You can test it's performance by noting what you servers memory and CPU usage are currently with apache and compare once you install nginx.

You would reduce memory used when compared using standalone Apache. You could also gain some performance improvements especially if you use some of the other features.



If you wish to use a php op-code cache then you will want to use Apache as backend + PHP Module, so the opcode cache is then shared between apache child processes. NGinx Frontend will serve all static requests, leaving Apache to handle dynamic requests (for a typical cs-cart webpage this will be 1 request / page). This means you can have a very stripped down Apache (remove many unused modules) serving just dynamic requests.



If you are going to use NGinx then it is best to download and compile from source, and include modules required (e.g. http_gzip_static module, http_ssl module …)

Apache Performance Hint

You can also gain some performance improvement with Apache by disabling htaccess rules. You will then need to set up these rules in your httpd.conf file (this will only be option for VPS or dedicated servers). So you will have all your per directory options in httpd.conf. This saves IO access time reading htaccess files.

In httpd.conf use following to disable reading of .htaccess files:-


AllowOverride None






DirectoryIndex index.php

Order allow,deny

Allow from all

Options +FollowSymLinks -Indexes -MultiViews -Includes

AllowOverride None



rewrite rules etc





Rules from sub-directory htaccess file



Sub-Directories: addons, catalog, controllers, core, images, js, lib, payments etc…

This might help you



http://www.sohaib.com/2013/04/10/nginx-configuration-for-cs-cart/