【问题标题】:I can't configure Varnish with Prestashop我无法使用 Prestashop 配置 Varnish
【发布时间】:2022-12-13 05:54:35
【问题描述】:

我正在设置清漆 来自这个网址https://github.com/nexylan/varnish-prestashop/blob/master/vcl/varnish4.vcl

我遇到的错误是我无法进入 prestashop 管理员,另一个问题是当我将产品添加到购物车时它不会保存它们

谢谢你。

# disable cookies for static files
    if (req.url ~ "\.(js|css|jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf|pdf)$" && ! (req.url ~ "\.(php)") ) {
        unset req.http.Cookie;
        return (hash);
    }

    # pipe on weird http methods
    if (req.method !~ "^GET|HEAD|PUT|PATCH|POST|TRACE|OPTIONS|DELETE$") {
        return(pipe);
    }

    if (req.method == "GET" && (req.url ~ "^/?mylogout=")) {
        unset req.http.Cookie;
        return (pass);
    }

    #we should not cache any page for Prestashop backend
    if (req.method == "GET" && (req.url ~ "^/admin")) {
        return (pass);
    }

    #we should not cache any custom directory
    if (req.method == "GET" && (req.url ~ "^/custom")) {
        return (pass);
    }

    #we should not cache any page for customers
    if (req.method == "GET" && (req.url ~ "^/authentification" || req.url ~ "^/mon-compte")) {
        return (pass);
    }

    #we should not cache any page for customers
    if (req.method == "GET" && (req.url ~ "^/informations" || req.url ~ "^/unt.php")) {
        return (pass);
    }

    #we should not cache any page for sales
    if (req.method == "GET" && (req.url ~ "^/commande" || req.url ~ "^/historique")) {
        return (pass);
    }

    #we should not cache any page for sales
    if (req.method == "GET" && (req.url ~ "^/adresse" || req.url ~ "^/order-detail.php")) {
        return (pass);
    }

    #we should not cache any page for sales
    if (req.method == "GET" && (req.url ~ "^/order-confirmation.php" || req.url ~ "^/order-return.php")) {
        return (pass);
    }

    #we should not cache any module
    if (req.method == "GET" && req.url ~ "^/module") {
        return (pass);
    }

    if (req.method != "GET" && req.method != "HEAD") {
        return (pass);
    }

【问题讨论】:

    标签: prestashop-1.7


    【解决方案1】:

    我能够进入管理员和模块。

    现在的问题是,当我以用户身份登录并添加产品时,会话关闭或未将产品保存在购物车中

    【讨论】:

      猜你喜欢
      • 2020-12-09
      • 2011-06-26
      • 2012-02-17
      • 2011-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多