baldden Posted August 16, 2013 Posted August 16, 2013 Всем привет. Закачиваю документацию для товара в pdf или doc и архив тоже пробовал, закачивается удачно, но когда нажимаешь скачать, файл скачивается очень долго и в итоге не открывается(пишет что файл поврежден). В чем может быть проблема? Вот пример: http://satam.kz/ru/lenovo/234-lenovo-ideaphone-p770/ в закладке Скачать, файл datasheet Share this post Link to post Share on other sites More sharing options...
absent Posted August 16, 2013 Posted August 16, 2013 Всем привет. Закачиваю документацию для товара в pdf или doc и архив тоже пробовал, закачивается удачно, но когда нажимаешь скачать, файл скачивается очень долго и в итоге не открывается(пишет что файл поврежден). В чем может быть проблема? Вот пример: http://satam.kz/ru/l...ideaphone-p770/ в закладке Скачать, файл datasheet По прямой ссылке нормально? Share this post Link to post Share on other sites More sharing options...
baldden Posted August 17, 2013 Posted August 17, 2013 подскажи куда преста складывает файлы, не смог найти, даже по имени файла. Share this post Link to post Share on other sites More sharing options...
absent Posted August 17, 2013 Posted August 17, 2013 подскажи куда преста складывает файлы, не смог найти, даже по имени файла. Дык по ftp доступ нормальный? что за хост? Share this post Link to post Share on other sites More sharing options...
baldden Posted August 17, 2013 Posted August 17, 2013 Vps хостинг от амазона. Сам админю, по фтп все ок. Могу подкрутить все что угодно, вот только ума не приложу где затык, это ероблемы с престой или с системой. Share this post Link to post Share on other sites More sharing options...
absent Posted August 17, 2013 Posted August 17, 2013 Vps хостинг от амазона. Сам админю, по фтп все ок. Могу подкрутить все что угодно, вот только ума не приложу где затык, это ероблемы с престой или с системой. в логах что? Share this post Link to post Share on other sites More sharing options...
baldden Posted August 19, 2013 Posted August 19, 2013 после тестов стало ясно что виноват nginx, у меня nginx+apache взял от сюда кусок конфига, и добавил себе http://doc.prestashop.com/display/PS15/System+Administrator+Guide#SystemAdministratorGuide-NginxfriendlyURLs получилось location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ { root /home/allwww/satam.kz/; index index.php; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; try_files $uri $uri/ /index.php?$args; } как бы сюда для аттачей добавить, не особо разбираюсь в конфиге nginx, по сути надо чтобы nginx либо напрямую с сервера отдавал аттач, или хотя бы не обробатывал а сразу апачу передавал ссылку, типа: http://satam.kz/ru/index.php?controller=attachment?id_attachment=3 Share this post Link to post Share on other sites More sharing options...
absent Posted August 19, 2013 Posted August 19, 2013 так если стоит апач почему хтаццесс с правилами nginx после тестов стало ясно что виноват nginx, у меня nginx+apache взял от сюда кусок конфига, и добавил себе http://doc.prestasho...inxfriendlyURLs получилось location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ { root /home/allwww/satam.kz/; index index.php; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; try_files $uri $uri/ /index.php?$args; } как бы сюда для аттачей добавить, не особо разбираюсь в конфиге nginx, по сути надо чтобы nginx либо напрямую с сервера отдавал аттач, или хотя бы не обробатывал а сразу апачу передавал ссылку, типа: http://satam.kz/ru/i...id_attachment=3 Share this post Link to post Share on other sites More sharing options...
baldden Posted August 19, 2013 Posted August 19, 2013 перемудрил, htaccess уже обрабатывает эти правила, ок. уберу их. нужно правило для nginx чтобы он аттач не обрабатывал Share this post Link to post Share on other sites More sharing options...
absent Posted August 19, 2013 Posted August 19, 2013 перемудрил, htaccess уже обрабатывает эти правила, ок. уберу их. нужно правило для nginx чтобы он аттач не обрабатывал Поддержка должна была решить вопрос. Share this post Link to post Share on other sites More sharing options...
baldden Posted August 19, 2013 Posted August 19, 2013 сервер мой, сам себе поддержка скорее всего плохо понимаю как конфигурить nginx. если у кого-то работает преста в такой связке как у меня, поделитесь конфигом настроек nginx+apache Share this post Link to post Share on other sites More sharing options...
absent Posted August 19, 2013 Posted August 19, 2013 вот nginx user www-data;worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { proxy_send_timeout 4000; proxy_read_timeout 4000; proxy_buffer_size 128k; proxy_buffers 64 128k; ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65000; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ## #include /etc/nginx/naxsi_core.rules; ## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; include /usr/local/ispmgr/etc/nginx.domain; client_max_body_size 160M; log_format isp '$bytes_sent $request_length'; для доменов location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ { root $root_path; access_log /var/www/nginx-logs/xxx isp; access_log /var/www/httpd-logs/xxx.ru.access.log ; error_page 404 = @fallback; Share this post Link to post Share on other sites More sharing options...
baldden Posted August 20, 2013 Posted August 20, 2013 вот кофиг для домена, если убрать реврайт, то картинки в престе показываться не будут. как же настроить что бы аттачи скачивались мимо nginx server { listen 80; server_name xxxx.kz; access_log /home/allwww/log/nginx.satam.kz-access_log combined; location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ { root /home/allwww/xxxx.kz/; index index.php; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; try_files $uri $uri/ /index.php?$args; } location ~ /\.ht { deny all; } location / { proxy_pass http://127.0.0.1:8080/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header Host $host; proxy_connect_timeout 60; proxy_send_timeout 90; proxy_read_timeout 90; proxy_redirect off; proxy_set_header Connection close; proxy_pass_header Content-Type; proxy_pass_header Content-Disposition; proxy_pass_header Content-Length; } } Share this post Link to post Share on other sites More sharing options...
absent Posted August 20, 2013 Posted August 20, 2013 вот кофиг для домена, если убрать реврайт, то картинки в престе показываться не будут. как же настроить что бы аттачи скачивались мимо nginx server { listen 80; server_name xxxx.kz; access_log /home/allwww/log/nginx.satam.kz-access_log combined; location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ { root /home/allwww/xxxx.kz/; index index.php; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; try_files $uri $uri/ /index.php?$args; } location ~ /\.ht { deny all; } location / { proxy_pass http://127.0.0.1:8080/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header Host $host; proxy_connect_timeout 60; proxy_send_timeout 90; proxy_read_timeout 90; proxy_redirect off; proxy_set_header Connection close; proxy_pass_header Content-Type; proxy_pass_header Content-Disposition; proxy_pass_header Content-Length; } } поддержка так и не сделали? Share this post Link to post Share on other sites More sharing options...
baldden Posted September 16, 2013 Posted September 16, 2013 т.к. тех поддержка это я сам, разбираться пришлось мне. включил дебак в лог и узнал что нет прав , записывать в папку /var/lib/nginx/ в Centos , кто поставит из пакетов nginx, имейте ввиду, что права нужно поменять на эту папку вручную, chmod 755 и chown apache:apache. Прирост ощутимы, но все равно хочется быстрее. На днях попробуй настроить nginx без апача. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now