Bug 61083

Summary: mod_proxy_html ignoring ProxyHTMLCharsetOut
Product: Apache httpd-2 Reporter: Antonio Suárez <a.suarez>
Component: mod_proxy_htmlAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P2    
Version: 2.4.25   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Apache 2.4.25 trace files with proxy-html enabled and disabled

Description Antonio Suárez 2017-05-10 10:09:06 UTC
Created attachment 34990 [details]
Apache 2.4.25 trace files with proxy-html enabled and disabled

Hi,

We're upgrading a site from Apache 2.2 and just found that version 2.4 seems to ignore the ProxyHTMLCharsetOut directive. 

Our setup:
* Fronted: SSL site on Apache 2.4.25. Output charset should be ISO-8859-1
* Backend: non-SSL site on Tomcat 8.5.6. Output charset is ISO-8859-1

Whenever we set: 

SetOutputFilter        proxy-html
ProxyHTMLCharsetOut    ISO-8859-1

the output charset is always UTF-8; if SetOutputFilter is commented out, then the output charset is ISO-8859-1 as expected.

This used to work fine on version 2.2. Wrong behaviour was first found on Debian 8 builtin package (version 2.4.10), but it's also happening on version 2.4.25 (downloaded as source and built with debian/rules makefile).

We've tried playing with xml2EncDefault, ProxyHTMLMeta, AddDefaultCharset and even mod_charset_lite with no result.

Trace files (error.log) with mod-proxy enabled and disabled are attached.

Thank you in advance. Best regards,
Comment 1 Nick Kew 2017-12-16 20:28:13 UTC
I've just investigated this.

There is a buglet: a HEAD request will incorrectly show UTF-8.  However, a request that returns data works just fine for me.  I'm inclined to say WONTFIX, but now that you've pointed it out I'll add a note to the docs.

Your problem is configuration.  Instead of "SetOutputFilter", you need to use ProxyHTMLEnable On (and have mod_xml2enc loaded) to cause mod_proxy_html to configure i18n.  I think that highlights a docs bug, and I'm thinking about how to add that prominently.