Apache Reverse Proxy erases <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

892 views Asked by At

this is my first post here.

I've already searched the forum for a related issue, but none of the results seems to solve my issue.

The setup is:

There is a MS Sharepoint 2010 deployed on IIS 7 in an internal customer network. This seems to behave correctly from within the internal network.

To make this service public, I have an apache 2.2 server running on Red Hat EL 6.0 on a DMZ. The apache has a vhost configured as Reverse proxy to allow the conections from outside.

Due to some links problems i found, I had to compile and integrate mod_proxy_html module to parse those Links.

The problem is that I see strange characters when accessing from outside (through the apache). And it is due to the Apache erasing an html meta tag:

From inside the MZ, the html code starts:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html dir="ltr" lang="es-ES"> 

    <head><meta http-equiv="X-UA-Compatible" content="IE=10" /><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><meta name="msapplication-TileImage" content="/_layouts/15/images/SharePointMetroAppTile.png" /><meta name="msapplication-TileColor" content="#0072C6" /><title>

However, when accessed from outside, the html code starts:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html dir="ltr" lang="es-ES">

<head><meta http-equiv="X-UA-Compatible" content="IE=10" /><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Expires" content="0" /><meta name="msapplication-TileImage" content="/_layouts/15/images/SharePointMetroAppTile.png" /><meta name="msapplication-TileColor" content="#0072C6" /><title> 

Tag missing: meta http-equiv="Content-type" content="text/html; charset=utf-8".

I have already tried adding to my httpd.conf:

AddDefaultCharset utf-8

ProxyHTMLCharsetOut utf-8

ProxyHTMLMeta On

The virtualhost is configured as follows (130.177.97.99 is the IP belonging to the backend):

<VirtualHost bpocenter-hp:5445> 
    ServerName www.bpocenter-hp.com 
    SSLProtocol -all +TLSv1 
    SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 
    SSLEngine on 
    SSLProxyEngine on 
    SSLCertificateChainFile /etc/httpd/cert_bpo-hp/intermediate.crt 
    SSLCertificateKeyFile /etc/httpd/cert_bpo-hp/server.key 
    SSLCertificateFile /etc/httpd/cert_bpo-hp/server.crt 

    ProxyHTMLEnable On 

    SetOutputFilter proxy-html 

    ProxyHTMLLogVerbose On 
    ProxyHTMLExtended on 

    ProxyHTMLMeta On 

    TransferLog "|/usr/serveis/app/apache/bin/rotatelogs /serveis/logs/bpocenter-hp/access_log 86400" 
    ErrorLog "|/usr/serveis/app/apache/bin/rotatelogs /serveis/logs/bpocenter-hp/error_log 86400" 

    ProxyRequests Off 

    ProxyPass / http://130.177.97.99:8065/ ttl=900 timeout=900 Keepalive=On 
    ProxyPassReverse / http://130.177.97.99:8065/ 
    RequestHeader      unset  Accept-Encoding 

    ProxyHTMLLinks  a               href 
    ProxyHTMLLinks  area            href 
    ProxyHTMLLinks  link            href 
    ProxyHTMLLinks  img             src longdesc usemap 
    ProxyHTMLLinks  object          classid codebase data usemap 
    ProxyHTMLLinks  q               cite 
    ProxyHTMLLinks  blockquote      cite 
    ProxyHTMLLinks  ins             cite 
    ProxyHTMLLinks  del             cite 
    ProxyHTMLLinks  form            action 
    ProxyHTMLLinks  input           src usemap 
    ProxyHTMLLinks  head            profile 
    ProxyHTMLLinks  base            href 
    ProxyHTMLLinks  script          src for 
    ProxyHTMLLinks  iframe          src 

    ProxyHTMLEvents onclick ondblclick onmousedown onmouseup \ 
            onmouseover onmousemove onmouseout onkeypress \ 
            onkeydown onkeyup onfocus onblur onload \ 
            onunload onsubmit onreset onselect onchange 

    SetOutputFilter proxy-html 
    ProxyHTMLURLMap http://130.177.97.99:8065 https://www.bpocenter-hp.com:5445 

Any help would be appreciated.

Thanks.

Juan

1

There are 1 answers

0
Fatih Demir On

I fixed this by using:

xml2EncDefault utf-8