ERR_INCOMPLETE_CHUNKED_ENCODING ao usar AddOutputFilterByType no proxy reverso do Apache

2

Estou tentando configurar um site de compras usando o Docker atrás de um proxy reverso do Apache2. Como o software Shopware, por algum motivo, coloca o host de back-end " link " no JavaScript que ele envia para o navegador, tentei usar mod_substitute para substituir com o nome do host externo:

ProxyPass / http://127.0.0.1:18084/
ProxyPassReverse / http://127.0.0.1:18084/

<Location />
    AddOutputFilterByType SUBSTITUTE text/html application/javascript
    Substitute "s!127.0.0.1:18084!my.real.domain.de!in"
</Location>

Isso funciona, ou seja, o nome do host é substituído. No entanto, alguns arquivos JavaScript são enviados usando codificação em partes, e isso causa problemas no navegador (saída do console JS):

GET http://my.real.domain.de/engine/Library/ExtJs/ext-all.js?201611281529 
net::ERR_INCOMPLETE_CHUNKED_ENCODING

Meu primeiro pensamento foi que a substituição estava atrapalhando os comprimentos dos fragmentos, mas o problema também ocorre quando eu removo a linha Substitute . Apenas ter uma linha AddOutputFilterByType para o tipo de conteúdo application/javascript causa o problema.

O proxy reverso do Apache é a versão 2.4.7, o backache apache é o 2.4.18.

Estou fazendo algo errado ou isso é um problema do apache? (Houve alguns problemas com o proxy reverso do apache atrapalhando o último bloco vazio do 2.2, mas acho que isso deve ser corrigido agora)

Atualização:

O ezra_s apontou que eu deveria ter certeza de que o cache do navegador não funcionaria com isso. Eu verifiquei usando curl :

Sem a linha AddOutputFilterByType e no Substitute no conf do host, o arquivo JS é transferido completamente (cerca de 1259k bytes). Com apenas a linha AddOutputFilterByType habilitada, recebo a seguinte saída:

here:~ tos$ curl http://my.real.domain.de/engine/Library/ExtJs/ext-all.js?201611281529
/*
This file is part of Ext JS 4.1

Copyright (c) 2011-2012 Sencha Inc

Contact:  http://www.sencha.com/contact

GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.

Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.

If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.

Build date: 2012-07-04 21:11:01 (65ff594cd80b9bad45df640c22cc0adb52c95a7b)
*/
curl: (18) transfer closed with outstanding read data remaining
here:~ tos$ 

Isso mostra um comportamento semelhante, mas mostra que não apenas o bloco final está ausente, mas tudo, exceto o primeiro bloco.

Eu verifiquei isso com o tcpdump. Também mostra apenas um pedaço chegando.

Atualização 2:

Isto parece ser um problema com o mod_substitute. No log de erros do meu proxy reverso, eu encontro a seguinte linha:

[Fri Dec 30 11:44:03.934066 2016] [substitute:error] [pid 2725] [client xxx.xxx.xxx.xxx:56492] AH01328: Line too long, URI /engine/Library/ExtJs/ext-all.js

Parece que o javascript está empacotado em uma linha longa, que é muito longa para mod_substitute , que falha mesmo antes de uma substituição ser definida.

Acho que vou reabrir isso como uma nova pergunta, se não conseguir encontrar uma solução para isso.

    
por Thomas Stets 30.12.2016 / 10:41

0 respostas