小编Lio*_*ate的帖子

入口 nginx 缓存

我试图弄清楚如何使用 nginx 代理缓存和一些特定的规则。例如,当我托管 Ghost 或 Wordpress 时,我不想缓存管理部分。使用服务器片段,我尝试了很多不同的组合,但管理部分的缓存仍然存在问题。

nginx.ingress.kubernetes.io/proxy-buffering: "on"
nginx.ingress.kubernetes.io/server-snippet: |-
  proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
  proxy_ignore_headers Set-Cookie;
  proxy_cache app_cache;
  proxy_cache_lock on;
  proxy_cache_valid any 30m;
  add_header X-Cache-Status $upstream_cache_status;
Run Code Online (Sandbox Code Playgroud)

我想在管理区域中使用 (ghost|sinout) 路径的 nginx 代码片段来绕过缓存,但我丢失了 proxy_pass 上下文,导致 502 错误网关。

这是当前缓存每个页面的入口配置,还有管理路径:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-buffering: "on"
    nginx.ingress.kubernetes.io/server-snippet: |-
      proxy_cache my_blog_cache;
      proxy_cache_lock on;
      proxy_cache_valid any 30m;
      add_header X-Cache-Status $upstream_cache_status;
      proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
  name: my-blog
  namespace: web
spec:
  rules:
  - host: blog.example.com
    http:
      paths:
      - backend:
          serviceName: ingress-541322b8660dbd2ceb1e8ff1813f0dd5
          servicePort: 2368
        path: / …
Run Code Online (Sandbox Code Playgroud)

kubernetes nginx-ingress

6
推荐指数
2
解决办法
9237
查看次数

无法呈现表单,因为块名称数组包含重复项

我正在使用Symfony 3.3.9,当我尝试渲染表单时,我有以下错误:

在呈现模板期间抛出了异常("无法呈现表单,因为块名称数组包含重复项:"_ fos_user_registration_form_errors","user_errors","user_errors","fos_user_registration_errors","form_errors".").

在此输入图像描述

预先感谢您的帮助 !

编辑17/09/2017 你去:

public function indexAction()
{
    /** @var $formFactory FactoryInterface */
    $formFactory = $this->get('fos_user.registration.form.factory');

    $form = $formFactory->createForm();

    return $this->render('AppTMMainBundle:Default:index.html.twig', array(
        'form' => $form->createView(),
    ));
}
Run Code Online (Sandbox Code Playgroud)

我的树枝:

{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register')}) }}
<div class="card-content">
    <h3 class="text-center title" style="color: #3C4858;margin:10px 0;">Inscription</h3>
    <div class="social text-center">
        <a class="btn btn-just-icon btn-round btn-facebook" href="{{ path('hwi_oauth_service_redirect',{'service': 'facebook'}) }}">
            <i class="fa fa-facebook"> </i>
        </a>
        <a class="btn btn-just-icon btn-round btn-twitter" href="{{ path('hwi_oauth_service_redirect',{'service': 'twitter'}) }}">
            <i class="fa fa-twitter"></i>
        </a>
        <a class="btn btn-just-icon …
Run Code Online (Sandbox Code Playgroud)

symfony-forms symfony twig fosuserbundle symfony-3.3

2
推荐指数
2
解决办法
1080
查看次数