zubzizub
8/8/2017 - 6:20 AM

конфиг опенкарта для nginx

конфиг опенкарта для nginx

listen 80;
charset utf-8;
index index.php;

#access_log  /var/log/nginx/web.access.log;
#error_log  /var/log/nginx/web.error.log;
access_log  /dev/stdout;
error_log  /dev/stderr;

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}



if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?_route_=$1 last;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php$ {
    include        fastcgi_params;
    fastcgi_pass   app:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    try_files $uri =404;
}

location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|doc|xls|xlsx)$ {
    try_files $uri $uri/ /index.php$is_args$args;
    access_log off;
    log_not_found off;
    expires	max;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one

location ~* /\. {
    deny all;
}