Nginx rules for OpenCart

Тестировалось на OpenCart 2.2.x и nginx 1.9.x SEO ссылки работают.
Tested with OpenCart 2.2.x and nginx 1.9.x SEO URL also works.
server {

listen       80;

        server_name  site.ua;
        root /home/site/site.ua;
        index index.php index.html;
    charset utf-8;
    rewrite /admin$ $scheme://$host$uri/ permanent;
    location / {
         try_files $uri @opencart;
    }
    location @opencart {
        rewrite ^/(.+)$ /index.php?_route_=$1 last;
    }
    location /admin {
        index index.php;
    }
    rewrite ^/sitemap.xml$ /index.php?route=feed/google_sitemap last;
    rewrite ^/googlebase.xml$ /index.php?route=feed/google_base last;
    rewrite ^/download/(.*) /index.php?route=error/not_found last;
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    sendfile off;
    location ~ .php$ {

root   /home/site/site.ua;

fastcgi_pass   127.0.0.1:9000;

        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;

fastcgi_param REDIRECT_STATUS 200;

fastcgi_read_timeout 3600;

    }
    location ~ /.ht {
        deny all;
    }
}

Оставить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *