https://bz.apache.org/bugzilla/show_bug.cgi?id=64339

            Bug ID: 64339
           Summary: mod_proxy_html changing docx header / file content,
                    leading to corrupt documents
           Product: Apache httpd-2
           Version: 2.4.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_proxy_html
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Have been banging my head against the wall for hours. Seems like mod_proxy_html
changes the header of a docx file served by the proxy, based on extension. I am
serving nextcloud over a proxy (vm serving nextcloud over http, load balancer
doing httpS, both apache)

Broken:
$ curl -s "https://cloud.domain.nl/oowriter.docx"; | xxd | head -n2
00000000: 504b 0304 1400 0808 0800 66c2 92c2 8a50  PK........f....P
00000010: 0000 0000 0000 0000 0000 0000 0b00 0000  ................
(Identified by `file` as "oowriter.docx.1: Zip archive data, at least v2.0 to
extract")

Working, same file, just different extension:
$ curl -s "https://cloud.domain.nl/oowriter.XXX"; | xxd | head -n2
00000000: 504b 0304 1400 0808 0800 6692 8a50 0000  PK........f..P..
00000010: 0000 0000 0000 0000 0000 0b00 0000 5f72  .............._r
(identified by `file` as "oowriter.XXX: Microsoft Word 2007+")

That is the gist of it. My setup:

[ User ] -- https --> [ Load balancer ]  -- http --> [ Nextcloud VM ]

Load balancer is Apache/2.4.6 (CentOS) , running on CentOS 7.7.1908
Nextcloud VM is Apache/2.4.6 (CentOS) (same)

Load balancer host config:

------------------------------------------------------------------
<IfModule mod_ssl.c>
<VirtualHost *:443>
        SSLEngine off
        ServerAdmin [email protected]
        ServerName cloud.domain.nl
#        ServerAlias www.domain.nl
        DocumentRoot "/var/www/html/"
        ErrorLog "/var/log/httpd/error_cloud_domain_nl.log"
        CustomLog /var/log/httpd/access_cloud_domain_nl.log combined
SSLCertificateFile /etc/letsencrypt/live/cloud.domain.nl/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cloud.domain.nl/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/cloud.domain.nl/chain.pem

ProxyHTMLEnable On
ProxyHTMLInterp On
ProxyPreserveHost Off
ProxyPass        / http://10.0.40.3:80/
ProxyPassReverse / http://10.0.40.3:80/
ProxyHTMLURLMap http://10.0.40.3:80/ /

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^/\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^/\.well-known/host-meta\.json /public.php?service=host-meta-json
[QSA,L]
  RewriteRule ^/\.well-known/webfinger /public.php?service=webfinger [QSA,L]
  RewriteRule ^/\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^/\.well-known/caldav /remote.php/dav/ [R=301,L]
</IfModule>


</VirtualHost>
</IfModule>
------------------------------------------------------------------


For the NextCloud, this is just nextcloud being served from /var/www/html
(default document root). Serving http. Nothing special.

Now the question is what changes my docx file in transit, where does it happen,
why does it happen, and how do I fix it.

Help appreciated. Thx

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to