• Как перенести бэкенд с apache на nginx?

    @tirael777 Автор вопроса
    помоему разобрался поменял конфиг на такой
    location / {
    try_files $uri $uri/ @rewrite;
    # try_files $uri $uri/ /index.php?q=$uri&$args;
    # try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    }
    всё грузится но оч долго почему?
  • Как перенести бэкенд с apache на nginx?

    @tirael777 Автор вопроса
    Вадим Мисбах-Соловьёв:
    Сделал я вот так, не работает, сайт не загружается в логах ничего, я в шоке от этого.
    server {
    listen 80;
    server_name multiblender.ru www.multiblender.ru;

    access_log /var/log/nginx-access.log;
    error_log /var/log/nginx-error.log;

    root /var/www/html/;
    index index.php index.html index.htm;

    location / {
    #try_files $uri $uri/ @rewrite;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    }

    location @rewrite {
    rewrite ^/(.*)$ /index.php?_route_=$1;
    }

    location = /sitemap.xml {
    rewrite ^ /index.php?route=feed/fast_sitemap last;
    }

    location = /googlebase.xml {
    rewrite ^ /index.php?route=feed/google_base last;
    }

    location /download/ {
    rewrite ^ /index.php?route=error/not_found last;
    }

    location ~* /yandexmarket\.(x|y)ml { rewrite ^ /index.php?route=feed/yandex_market;
    }

    location ~* \.(ico|jpe?g|gif|png|css|js|pdf|txt|tar|t?gz|t?bz2|deb|t?xz|zip|svgz?|flac|ogg|avi|rar|mp([[:digit:]]|e?g)|xls|pp(t|s)|ps|patch|diff|od(t|s|p)|pot?|psd)$ {
    expires max;
    }

    open_file_cache max=10000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;
    # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
    location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
    }

    location = /favicon.ico {
    access_log off;
    log_not_found off;
    }

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }

    location ~ \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js|mov|avi|mp4|mpeg4) {
    root /var/www/html;
    }

    location ~ /.ht {
    deny all;
    }
    }
  • Как перенести бэкенд с apache на nginx?

    @tirael777 Автор вопроса
    apache стоит и php5.6 что ещё нужно знать?
  • Как перенести бэкенд с apache на nginx?

    @tirael777 Автор вопроса
    1)По моему ясно написано "используется fastcgi для phpmyadmin." поддомен сделан и отдельный site_enable.
    2)php-fpm стоит, как подцеплять?

    файл .htacess
    Options +SymLinksIfOwnerMatch

    # Prevent Directoy listing
    Options -Indexes

    #AddDefaultCharset UTF-8
    #AddCharset utf-8 *
    #IndexOptions +Charset=UTF-8
    #
    #CharsetSourceEnc utf-8
    #CharsetDefault utf-8
    #

    Order Deny,Allow
    Deny from 144.76.70.117
    Deny from 91.223.138.2
    Deny from 68.180.231.53
    Deny from 66.249.78.229
    Allow from all

    # Prevent Direct Access to files

    Order deny,allow
    Deny from all

    #
    #Header set Cache-Control "max-age=604800"
    #
    Header set Cache-Control "max-age=2592000, must-revalidate"

    DirectoryIndex index.html index.php

    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript

    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

    RewriteEngine On
    # If your opencart installation does not run on the main web folder make sure yo
    u folder it does run in ie. / becomes /shop/

    RewriteBase /

    RewriteCond %{HTTP_HOST} ^www.site.ru
    RewriteRule ^(.*)$ site.ru/$1 [R=301,L]
    RewriteRule ^sitemap.xml$ index.php?route=feed/fast_sitemap [L]
    #RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap_fast [L]
    RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
    RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?site.ru [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/
    RewriteRule ^index\.html$ / [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ / [R=301,L]
    RewriteCond %{QUERY_STRING} ^route=common/home$
    RewriteCond %{REQUEST_METHOD} !^POST$
    RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]
    RewriteCond %{HTTP_HOST} ^163\.172\.140\.253$
    RewriteRule ^(.*)$ site.ru/$1 [L,R=301]

    RewriteCond %{REQUEST_URI} !=/server-status

    # YAhoo robots off
    #RewriteCond %{REQUEST_URI} !^/robots\.txt$
    #RewriteCond %{HTTP_USER_AGENT} ^.*Slurp.*$ [NC]
    #RewriteRule .* - [F,L]
    # Yahoo robots off

    php_flag display_startup_errors on
    php_flag display_errors on
    php_flag html_errors on
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    cookie небольшая текстовая информация передаваемая сервером и хранящиеся на стороне пользователя, которая далее может использоваться.(заполненные формы,контакты)
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров: куки лучше отключить?
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров:
    proxy_ignore_headers "Set-Cookie";
    proxy_hide_header "Set-Cookie";
    это должно помоч?
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров: Добавил опцию, похоже что не помогло. И очень странно что в разных браузерах ответы получаю разные.
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров: какой вариант решения?
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    запрещено на apache? хотелось бы кэшировать на nginx
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров:

    Remote Address:163.172.140.253:80
    Request URL:ru/tehnika-dlja-kuhni/mikrovolnovye-pechi/proizvod...
    Request Method:GET
    Status Code:200 OK
    Request Headersview source
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Accept-Encoding:gzip,deflate
    Accept-Language:ru-RU
    Cache-Control:max-age=0
    Connection:keep-alive
    Cookie:PHPSESSID=f7safuniltk17jkhdvtnd6ijd1; currency=RUB; _ym_uid=1467180845336531808; _ym_isad=1; _gat=1; language=ru; _ga=GA1.2.811076827.1467180845; _ym_visorc_29245905=w
    DNT:1
    Host:.ru
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.1.1000 Chrome/39.0.2146.0 Safari/537.36
    X-DevTools-Emulate-Network-Conditions-Client-Id:B36E6571-DBE9-44DF-B02F-FA426402116B
    Response Headersview source
    Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Length:13480
    Content-Type:text/html; charset=utf-8
    Date:Thu, 30 Jun 2016 06:51:51 GMT
    Expires:Thu, 19 Nov 1981 08:52:00 GMT
    Pragma:no-cache
    Server:nginx
    Set-Cookie:language=ru; expires=Sat, 30-Jul-2016 06:51:43 GMT; Max-Age=2592000; path=/; domain=.ru
    Vary:Accept-Encoding
    X-Powered-By:PHP/5.6.22-0+deb8u1
  • Почему Nginx не кэширует?

    @tirael777 Автор вопроса
    Андрей Буров:

    <code>Remote Address:213.180.193.119:443
    Request URL:https://mc.yandex.ru/watch/29245905?wmode=5&callback=_ymjsp635176143&page-url=http%3A%2F%2F%2F&site-info=%7B%7D&browser-info=j%3A1%3As%3A1920x1080x24%3Ask%3A1%3Af%3A15.0.0%3Al%3A5.1.41212.0%3Afpr%3A45034851501%3Acn%3A1%3Aw%3A1449x514%3Az%3A180%3Ai%3A20160630093435%3Aet%3A1467268476%3Aen%3Autf-8%3Av%3A689%3Ac%3A1%3Ala%3Aru-ru%3Antf%3A2%3Apv%3A1%3Als%3A1171551676474%3Arqn%3A3552%3Arn%3A433634823%3Ahid%3A46186213%3Ads%3A1%2C56%2C2085%2C1%2C0%2C0%2C%2C851%2C54%2C%2C%2C%2C2998%3Awn%3A36376%3Ahl%3A2%3Arqnl%3A1%3Ast%3A1467268476%3Au%3A1467180845336531808%3At%3A%D0%91%D1%8B%D1%82%D0%BE%D0%B2%D0%B0%D1%8F%20%D1%82%D0%B5%D1%85%D0%BD%D0%B8%D0%BA%D0%B0%20-%20%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C%2C%20%D1%86%D0%B5%D0%BD%D1%8B%2C%D0%B8%20%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D0%BD%D0%B8%D0%BA%D0%B0%2C%20%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B5%D1%82%20%D0%BC%D0%B0%D0%B3%D0%B0%D0%B7%D0%B8%D0%BD%2C%20%D0%B2%20%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B5
    Request Method:GET
    Status Code:200 OK
    Request Headersview source
    Accept:*/*
    Accept-Encoding:gzip,deflate
    Accept-Language:ru-RU
    Cache-Control:max-age=0
    Connection:keep-alive
    Cookie:yabs-sid=1561915821467180846; L=RB9BdGdfZwAGdwFzcgBUaHpffk55bnFVDBxQOBcaLCs6KjVYDDgDUx1vFRw=.1467180927.12493.354502.4d4970e19b15af5f9303d57942aa2962; yandex_login=info@; yandex_gid=213; yandexuid=1486194331459321473; fuid01=56fb7e1d3cb617e8.PwJIW8FNpCL1qh4xwAVtfOURtKpvfEZn-cWENvDSfPNSIewllNW9mEPyltJl-UafrOltrQ7TLNURDkAkDMKAP2MKjkO8L4oxwOmDTDgSnkFkHH-zYLVsaZn2Gfifne9I; ys=udn.cDppbmZvQG11bHRpYmxlbmRlci5ydQ%3D%3D#ymrefl.F838D0009F2C3EB7; _ym_uid=1467211445367637942; yabs-frequency=/4/4W00040DSLS00000/paMmS0GbPm00/; _ym_isad=1; yp=1782540927.udn.cDppbmZvQG11bHRpYmxlbmRlci5ydQ%3D%3D#1469773047.ygu.1#1474957047.ww.1#1482979449.szm.1_00:1920x1080:1922x922; Session_id=3:1467267473.0.0.1467180859000:kb2lXw:85.0|1130000014116174.68.2.2:68|147905.20796.ZUoScv83cxQ7mMeYzjqhRO-0z4k; sessionid2=3:1467267473.5.0.1467180859000:kb2lXw:85.1|1130000014116174.68.2.2:68|147905.908017.WmcqX-PhXEJMmskD0tf8XPcje70
    DNT:1
    Host:mc.yandex.ru
    Referer:
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.1.1000 Chrome/39.0.2146.0 Safari/537.36
    X-DevTools-Emulate-Network-Conditions-Client-Id:B36E6571-DBE9-44DF-B02F-FA426402116B
    Query String Parametersview sourceview URL encoded
    wmode:5
    callback:_ymjsp635176143
    page-url:
    site-info:{}
    browser-info:j:1:s:1920x1080x24:sk:1:f:15.0.0:l:5.1.41212.0:fpr:45034851501:cn:1:w:1449x514:z:180:i:20160630093435:et:1467268476:en:utf-8:v:689:c:1:la:ru-ru:ntf:2:pv:1:ls:1171551676474:rqn:3552:rn:433634823:hid:46186213:ds:1,56,2085,1,0,0,,851,54,,,,2998:wn:36376:hl:2:rqnl:1:st:1467268476:u:1467180845336531808:t:Бытовая техника - купить, цены,и электроника, интернет магазин, в Москве
    Response Headersview source
    Cache-Control:private, no-cache, no-store, must-revalidate, max-age=0
    Connection:keep-alive
    Content-Length:132
    Content-Type:application/javascript
    Date:Thu, 30 Jun 2016 06:34:37 GMT
    Expires:Thu, 30 Jun 2016 06:34:37 GMT
    Last-Modified:Thu, 30 Jun 2016 06:34:37 GMT
    P3P:CP="NOI DEVa TAIa OUR BUS UNI STA"
    Pragma:no-cache
    Server:nginx/1.8.0
    Strict-Transport-Security:max-age=31536000
    X-Content-Type-Options:nosniff</code>


    Remote Address:163.172.140.253:80
    Request URL:
    Request Method:GET
    Status Code:200 OK
    Request Headersview source
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Accept-Encoding:gzip,deflate
    Accept-Language:ru-RU
    Cache-Control:max-age=0
    Connection:keep-alive
    Cookie:PHPSESSID=f7safuniltk17jkhdvtnd6ijd1; currency=RUB; _ym_uid=1467180845336531808; language=ru; _ga=GA1.2.811076827.1467180845
    DNT:1
    Host:
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.9.1.1000 Chrome/39.0.2146.0 Safari/537.36
    X-DevTools-Emulate-Network-Conditions-Client-Id:B36E6571-DBE9-44DF-B02F-FA426402116B
    Response Headersview source
    Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Length:12543
    Content-Type:text/html; charset=utf-8
    Date:Thu, 30 Jun 2016 06:34:36 GMT
    Expires:Thu, 19 Nov 1981 08:52:00 GMT
    Pragma:no-cache
    Server:nginx
    Set-Cookie:language=ru; expires=Sat, 30-Jul-2016 06:34:34 GMT; Max-Age=2592000; path=/; domain=
    Vary:Accept-Encoding
    X-Powered-By:PHP/5.6.22-0+deb8u1