You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Klaubert Herr da Silveira <kl...@yahoo.com> on 2004/06/29 21:56:09 UTC
[users@httpd] Charset-lite and proxy_html example needed!
I'm configuring apache (2.0.40, redhat 9, compiled with mod_charset_lite) as a
reverse proxy for my internal web servers, and need to rewrite some url's
inside html and .js files on-the-fly.
To this I'm using mod_proxy (to reverse proxy) and mod_proxy_html (to rewrite
html), the problem is that mod_proxy_html convert all html content to UTF-8,
but .js (javascript's) files, with this I get a misconfigured page (eg, a
pop-up in js, wrong accentuation (my language have accents)).
In apacheweek, the developer of mod_proxy_html sugest to use mod_charset_lite
in this situation... I can't figure out how to put this working together.
I believe that can be a order in output filter, but I could not found any
example.
Can anybody send a working example os mod_proxy + mod_proxy_html +
mod_charset_lite?
Thanks in advance,
Klaubert
PS. Below some configuration that I'm using.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
LoadModule charset_lite_module modules/mod_charset_lite.so
DocumentRoot "/var/www/html"
CharsetSourceEnc ISO8859-1 # to catch .js files (no success)
CharsetDefault UTF-8
AddDefaultCharset UTF-8
<VirtualHost _default_:81>
ErrorLog logs/virtual-error_log
CustomLog logs/virtual-access_log common
ProxyPass /app1/ http://internal-server/app1/
ProxyHTMLURLMap http://internal-server/app1/ /app1/
<Location /cbe/>
ProxyPassReverse http://internal-server/app1/
ProxyHTMLDoctype HTML Legacy
SetOutputFilter proxy-html
ProxyHTMLURLMap /app1/ /app1/
RequestHeader unset Accept-Enconding
</Location>
</virtualhost>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Charset-lite and proxy_html example needed!
Posted by Nick Kew <ni...@webthing.com>.
On Tue, 29 Jun 2004, Klaubert Herr da Silveira wrote:
> I'm configuring apache (2.0.40,
Aaargh! That's a museum-piece, not an operational webserver.
> To this I'm using mod_proxy (to reverse proxy) and mod_proxy_html (to rewrite
> html), the problem is that mod_proxy_html convert all html content to UTF-8,
> but .js (javascript's) files, with this I get a misconfigured page (eg, a
> pop-up in js, wrong accentuation (my language have accents)).
mod_proxy_html doesn't process javascript files. It would be rather
futile to run a *javascript* file through an *html* parser! The code
if ( f->r->proxyreq && f->r->content_type ) {
if ( strncasecmp(f->r->content_type, "text/html", 9) &&
strncasecmp(f->r->content_type, "application/xhtml+xml", 21) ) {
ap_remove_output_filter(f) ;
return NULL ;
}
}
ensures it won't parse javascript file (unless your backend is badly
broken).
> In apacheweek, the developer of mod_proxy_html sugest to use mod_charset_lite
> in this situation... I can't figure out how to put this working together.
>
> I believe that can be a order in output filter, but I could not found any
> example.
That would presumably be SetOutputFilter proxy-html;charset-lite
(or whatever the charset-lite filter calls itself).
--
Nick Kew
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org