2017-04-09 6 views
1

Chrome’s Data Saver on Androidを使用して、私のsymfony公式サイトへのアクセスが発生使ってsymfonyのアプリケーションにアクセスするとエラーここでは500は、ChromeのデータセーバーがBadRequestHttpException

は私がChromeのデータセーバーは、リバースプロキシとして動作し理解するものから、ログ

[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)"} [] 

で生成します私のアプリケーションの前にコードと画像を圧縮します。

私はこの文書をhow to use a reverse proxy in front of a Symfony appについて読んでいます。

問題は、IP Chromeのデータセーバープロキシが使用していることに関するドキュメントが見つかりません。

ありがとうございました!

答えて

1

重要な情報はここにある:

要求は、信頼できる転送されたヘッダと、信頼できるクライアントのIPヘッダ

の両方を持っている私は、問題や定着をお勧めします - をあなたは持っていない場合

これはおそらく、あなたのweb /ディレクトリのapp.phpまたはapp_dev.phpで行います。 $リクエストが作成された直後。

0

このエラーはDrupal 8.3(おそらく8.0/1/2も)にも影響することに注意してください。また、FORWARDEDヘッダーは他のものと同様に偽造される可能性があり、受け入れるプロキシアドレスをリストすることはできません(AFAIK)。したがって、ユーザーがChromeデータセーバーを有効にするたびに、FORWARDEDヘッダーに頼ることができないため、基本的にIPを取得できなくなります。

X_FORWARDED_FORを信頼するデフォルトの動作では、信頼できるリバースプロキシ(つまり、管理しているプロキシ)のリストを添付すると動作します。

(フランスのように)法律でユーザーが作成したコンテンツのユーザーIPを把握しなければならない場合には、問題が発生する可能性があります。

関連する問題