Android 使用Chrome'访问Symfony应用程序;s数据保存程序导致BadRequestHttpException

Android 使用Chrome'访问Symfony应用程序;s数据保存程序导致BadRequestHttpException,android,symfony,reverse-proxy,chrome-datasaver,Android,Symfony,Reverse Proxy,Chrome Datasaver,使用访问我的Symfony网站会产生错误500 这是日志 [2017-04-06 18:56:23] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "The request headers contain conflicting information regarding the origin of this request." at /h

使用访问我的Symfony网站会产生错误500

这是日志

[2017-04-06 18:56:23] request.ERROR: Uncaught PHP Exception
Symfony\Component\HttpKernel\Exception\BadRequestHttpException:
"The request headers contain conflicting information regarding the origin of this request." at /home/myapp/app/bootstrap.php.cache line 3184
{"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): The request headers contain conflicting information regarding the origin of this request. at /home/myapp/app/bootstrap.php.cache:3184, Symfony\\Component\\HttpFoundation\\Exception\\ConflictingHeadersException(code: 0): The request has both a trusted Forwarded header and a trusted Client IP header, conflicting with each other with regards to the originating IP addresses of the request. This is the result of a misconfiguration. You should either configure your proxy only to send one of these headers, or configure Symfony to distrust one of them. at /home/myapp/app/bootstrap.php.cache:788)"} []
据我所知,Chrome的数据保护程序在我的应用程序压缩代码和图像之前充当反向代理

我读过这个文件

问题是我没有找到任何关于IP Chrome的数据保护程序代理正在使用的文档


谢谢你的帮助

关键信息如下:

该请求同时具有受信任的转发标头和受信任的客户端IP标头

我建议您解决此问题,或者-如果您没有权限-禁用文档中描述的冲突标头:


您可能希望在web/目录中的app.php或app_dev.php中执行此操作。就在$request创建之后。

这个错误也会影响Drupal 8.3(可能也会影响8.0/1/2)。而且你不能真正信任转发的头,因为它可以像其他头一样伪造,而且你不能(AFAIK)列出接受它的代理地址。因此,每当用户启用Chrome数据保护程序时,您基本上就失去了获取其IP的能力,因为您无法依赖转发头

信任X_FORWARDED_FOR works的默认行为,如果您附带受信任的反向代理列表(即您可以控制的代理)

这可能是一个问题,法律强制您跟踪任何用户生成内容的用户IP(如在法国)