ReverseProxy und ReplacePattern
4 posts
• Page 1 of 1
ReverseProxy und ReplacePattern
Hi
I have no luck to get 'ReplacePattern' with the 'ProxyPass' working together.
Env is my local machine WIN7 with IIS8 Express and APE 3.1.0.135.
My httpd.conf:
The reverse proxy is working fine, but it does not replace anything.
It should replace all links from 'http://www.swisscom.ch/' to '/'.
I tried to remove the 'intype=text/html' flag or with a simple replace like
ReplacePattern revproxy "a" "b"
But nothing gets replaced.
Thanks for help!
I have no luck to get 'ReplacePattern' with the 'ProxyPass' working together.
Env is my local machine WIN7 with IIS8 Express and APE 3.1.0.135.
My httpd.conf:
- Code: Select all
Loglevel debug
Options +StopOnError +ShowErrorInResponse
LoadModule env_module modules/mod_env.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule replace_module modules/mod_replace.so
ReplaceFilterDefine revproxy CaseIgnore intype=text/html
ReplacePattern revproxy "http:\/\/www\.swisscom\.ch\/" "/"
SetEnv mod_replace revproxy
ProxyPass / http://www.swisscom.ch/
ProxyPassReverse / http://www.swisscom.ch/
The reverse proxy is working fine, but it does not replace anything.
It should replace all links from 'http://www.swisscom.ch/' to '/'.
I tried to remove the 'intype=text/html' flag or with a simple replace like
ReplacePattern revproxy "a" "b"
But nothing gets replaced.
Thanks for help!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: ReverseProxy und ReplacePattern
Hello,
Here're some things to consider:
1. In the line
you'd need to specify the type of content you can actually see in the browser, e.g. "text/html; charset=UTF-8"
2. Sometimes the response fro back-end is zipped.
In any case it'd be beneficial to see the error.log, after enabling the logs.
Regards
Here're some things to consider:
1. In the line
ReplaceFilterDefine revproxy CaseIgnore intype=text/html
you'd need to specify the type of content you can actually see in the browser, e.g. "text/html; charset=UTF-8"
2. Sometimes the response fro back-end is zipped.
In any case it'd be beneficial to see the error.log, after enabling the logs.
Regards
Re: ReverseProxy und ReplacePattern
Hi!
Did you try it without the backslashes?
I think this should work:
ReplacePattern revproxy "http://www.swisscom.ch/" "/"
cheers
swobi
Did you try it without the backslashes?
I think this should work:
ReplacePattern revproxy "http://www.swisscom.ch/" "/"
cheers
swobi
Re: ReverseProxy und ReplacePattern
Hi
Thank you for your answers.
I try to add the "text/html; charset=UTF-8" but it didn't help.
Also tried to remove the backslashes in the replace pattern, but it does not work.
Here is a export of the error.log when accessing a page witch should be replaced
Yes, the backend server response is gzipped.
How can i remove the 'gzip' in the 'Accept-Encoding' header before the request is send to the backend server?
Thanks for help.
Edit:
Ok i figure it out, after i remove the gzip in the header, it works now.
Here the config line:
cheers
Thank you for your answers.
I try to add the "text/html; charset=UTF-8" but it didn't help.
Also tried to remove the backslashes in the replace pattern, but it does not work.
Here is a export of the error.log when accessing a page witch should be replaced
- Code: Select all
[2014-07-08 13:45:49.322] [LicenseManager] Credentials for Swisscom (Schweiz) AG are valid
[2014-07-08 13:45:55.570] [proxy] (debug) [/de/privatkunden/swisscom-tv/sender.html] request to http://www.swisscom.ch/de/privatkunden/swisscom-tv/sender.html
... lot of requests to css,js,images...
Yes, the backend server response is gzipped.
How can i remove the 'gzip' in the 'Accept-Encoding' header before the request is send to the backend server?
Thanks for help.
Edit:
Ok i figure it out, after i remove the gzip in the header, it works now.
Here the config line:
- Code: Select all
RequestHeaderPattern Accept-Encoding "gzip" " "
cheers
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests