Proxy Server 2007-08-14 - By Martin Gainty
Back The stock answer is to setup mod_proxy under Apache and use Apache to front-end load all your requests (details located here) http://tomcat.apache.org/tomcat-5 (See http://cat-5.ora-code.com).5-doc/proxy-howto.html
Note that If you have any appreciable amount of static content (watch your jmeter perf nosedive) then you will want to look into implementing mod_jk
If you dont want to go thru the complexity of installing yet another system then you can use the tried and true request.getHeader as in String Referer_value = request.getHeader(HTTP_REFERER) and redirect the request according to some criteria
if Referer_value == "localhost" (this request is for my server so process normally) else { String serverURL = request.getParameter("serverURL"); String deployuri = request.getParameter("deployuri");
String redirectURL = serverURL + deployuri; response.sendRedirect(redirectURL); }
If you've installed Tomcat the example code to retrieve headers is located at http://YourComputer:8080/servlets-examples/reqheaders.html
Viel Gluck/ Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you.
-- -- Original Message -- -- From: <Dooing@(protected)> To: <users@(protected)> Sent: Tuesday, August 14, 2007 11:21 AM Subject: Proxy Server
> Hi, > > I am using a Tomcat 5.5.9 server (only for development) on my local pc, > within a company network that is using a proxy server. Problem: My > application does http requests to a server were a proxy is required, as > well as requests to an > IP adress were no proxy is required / allowed. I added these 2 lines to my > catalina.properties file: > > http.proxyPort=<MYPROXY_PORT> > http.proxyHost= <MYPROXY_URL> > > If I add these lines, the service that requires the proxy works, however > the other service does not work - and vice versa. > > Is there a way to configure Tomcat so that I may use a proxy, but exlude > certain URLS, just like you can do in a browser? > > Thanks in advance, > > Marcus > > > -- > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ > To start a new topic, e-mail: users@(protected) > To unsubscribe, e-mail: users-unsubscribe@(protected) > For additional commands, e-mail: users-help@(protected) > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To start a new topic, e-mail: users@(protected) To unsubscribe, e-mail: users-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
|
|