For quite some time I have used URL_Rewrite and ARR to reverse proxy from IIS back to different tomcat apps successfully. Now I am trying to do the same but now require to use a different name for the rewritten url. For example, I want the url
http://mypubsite/app1 to reverse proxy to
http://tomcatserver:8080/someotherappname. When I use my standard tried and true rule, I wind up getting bounced back to
http://mypubsite/someotherappname which of course generates a 404. Can this be done with these tools or do I need to use something third party like url rewriter?
You'll want to create two rules. The first should rewrite app1 to someotherappname and NOT stop processing subsequent rules. The second should route to a server farm that contains tomcatserver on the non-standard port of 8080.
I can't seem to get this to work. I still get a 404 seemingly because the first rewrite rule ignores the second and is looking for a physical path to the file. So in a nutshell, if I request /pls/htmldb/f?p=156 I get a 404 looking for physical path C:\inetpub\wwwroot\apex\f
if I request /apex/f?p=156 it works fine.
I did get this to work, I think I was just not restarting my browser at the right time. The problem is the new proxy also rewrites the URLs and if I try to use an outbound rule to fix them up, I run into the GZIP problem. I can't turn off gzip withotu dealing
with other hurdles so I am going to see how much pain there is in just doing a redirect and letting them update their configurations and so forth. Thanks for the help.
Fat Maul
8 Posts
reverse proxy using non-matching URLs
Feb 24, 2012 08:18 PM|LINK
For quite some time I have used URL_Rewrite and ARR to reverse proxy from IIS back to different tomcat apps successfully. Now I am trying to do the same but now require to use a different name for the rewritten url. For example, I want the url http://mypubsite/app1 to reverse proxy to http://tomcatserver:8080/someotherappname. When I use my standard tried and true rule, I wind up getting bounced back to http://mypubsite/someotherappname which of course generates a 404. Can this be done with these tools or do I need to use something third party like url rewriter?
owjeff
680 Posts
Re: revers eproxy using non-matching URLs
Feb 26, 2012 04:32 PM|LINK
You'll want to create two rules. The first should rewrite app1 to someotherappname and NOT stop processing subsequent rules. The second should route to a server farm that contains tomcatserver on the non-standard port of 8080.
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."
Fat Maul
8 Posts
Re: revers eproxy using non-matching URLs
Feb 26, 2012 05:43 PM|LINK
owjeff
680 Posts
Re: revers eproxy using non-matching URLs
Feb 26, 2012 06:06 PM|LINK
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."
Fat Maul
8 Posts
Re: revers eproxy using non-matching URLs
Feb 27, 2012 03:54 PM|LINK
I can't seem to get this to work. I still get a 404 seemingly because the first rewrite rule ignores the second and is looking for a physical path to the file. So in a nutshell, if I request /pls/htmldb/f?p=156 I get a 404 looking for physical path C:\inetpub\wwwroot\apex\f if I request /apex/f?p=156 it works fine.
<rewrite>
<rules>
<clear />
<rule name="htmldb to apex rule">
<match url="^pls/htmldb(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="apex{R:1}" />
</rule>
<rule name="APEX mod_plsql Requests" stopProcessing="true">
<match url="^apex(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="http://someserver:8080/apex{R:1}" logRewrittenUrl="false" />
</rule>
</rules>
</rewrite>
Fat Maul
8 Posts
Re: revers eproxy using non-matching URLs
Feb 27, 2012 05:50 PM|LINK