Jump to content



Member Since 19 Nov 2009
Offline Last Active Jul 21 2014 05:42 PM

#80964 cs-cart on nginx web server

Posted by Net-burst on 25 May 2010 - 10:40 PM

Ok, I have found better and more elegant solution for rewrite in nginx:
# Deny acces to .htaccess files in case i forget to remove them.
    location ~ /\.ht {
        deny  all;
# Main location to serve static files.
    location / {
        root /srv/http/mir-shin/htdocs;
        index index.php;
# First rewrite rule: this rule tries to access file of the request,
# if failed - directory, and if that also fails - rewrites request to php.
        try_files $uri $uri/ /index.php?sef_rewrite=1;
# Location for static catalog, which i don't use, but decided to leave
# it in my config in case I'll decide to actually use static catalog.
    location ~ /catalog {
        try_files $uri/index.html /index.php?sef_rewrite=1;

If someone is interested in tutorial for nginx + php-fpm with CS-Cart, i can write one when I'll have time.