logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: proxy is somehow removing meta charset=iso-8859-1
Author
MeSo2



Joined: 28 Apr 2016
Posts: 12

PostPosted: Thu 25 Aug '16 3:02    Post subject: proxy is somehow removing meta charset=iso-8859-1 Reply with quote

I am using an Apache 2.4 (Server A) proxy to expose an internal Apache 2.4 (Server B) proxy to a IIS website. The internet to server is via https.

Internet <= https => Apache (Server A) <= http => Apache (Server B) <= http => IIS

Calling the page directly internally IIS gives me the same result as calling it internally via Apache (Server B):
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fb="http://ogp.me/ns/fb#" xmlns="http://www.w3.org/1999/xhtml">
<head>
<Meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


Now calling that same page via SSL Apache (Server A) I am getting:
Code:
<html xmlns:fb="http://ogp.me/ns/fb#" xmlns="http://www.w3.org/1999/xhtml"><head>

The Meta Content-Type is stripped away. Also, the opening DOCTYPE tag is missing.

I am using on Server A:
Code:
ProxyHTMLCharsetOut *
AddDefaultCharset ISO-8859-1
RequestHeader unset Accept-Encoding

But I am getting strange characters.

Instead of It's I am getting It’s.

Also
Code:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
is producing
Code:
ÂÂ&nbsp;ÂÂ&nbsp;ÂÂ&nbsp;ÂÂ&nbsp;ÂÂ&nbsp


The Responce Headers:
Code:
Cache-Control: private
Connection: Keep-Alive
Content-Type: text/html;charset=ISO-8859-1
Date: Thu, 25 Aug 2016 00:52:33 GMT
Keep-Alive: timeout=5, max=100
Server: Microsoft-IIS/10.0
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
X-Powered-By: ASP.NET


Any help would be very much appreciated!
Back to top
MeSo2



Joined: 28 Apr 2016
Posts: 12

PostPosted: Thu 25 Aug '16 20:52    Post subject: Reply with quote

I solved it! It had nothing to do with https.

But if you ask me it is an Apache Bug... no default will default to utf-8 instead of taking the value of the page proxy-ed.

Server (B) had no default charset defined. So when Server (B) was proxying page to Server (A) the page meta got stripped away.

After adding
Code:
ProxyHTMLCharsetOut *    # keeps original charset intact
and loading the required modules on server (B) all is well now.

The IIS code is passed on untouched!
Back to top


Reply to topic   Topic: proxy is somehow removing meta charset=iso-8859-1 View previous topic :: View next topic
Post new topic   Forum Index -> Apache