Problem with reverse proxy

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Problem with reverse proxy

15 May 2014, 10:31

Hi

We have isapi rewrite 3 on our system.

Now we need to configure a reverse proxy in order to call a virtual dir in
iis and proxy to an internal server on 8080 port where is Tomcat.

I read different examples on forum, for example:
RewriteEngine on
RewriteBase /
RewriteRule ^myApp/(.+)$ http://internalIpAddress:8080/myApp/$1 [NC,P]

or

ProxyPass /myApp/ http://internalIpAddress:8080/myApp/

ProxyPassReverse / myApp / http://internalIpAddress:8080/myApp/


but nothing works

I simply installed ISAPI_Rewrite.dll and ISAPI_RewriteProxy.dll on IIS

Is there any other things to configure in order to enable reverse proxy? In Apache Webserver I usually load mod_proxy module to enable reverseproxy. Here is the same? If yes, where can I load that module? If not, which is the right solution to do that?

Thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with reverse proxy

16 May 2014, 06:53

Hello,

If it's ISAPI_Rewrite 3 you are using, then the rule should be like:

RewriteEngine on
RewriteBase /
RewriteRule ^myApp/(.+)$ http://internalIpAddress:8080/myApp/$1 [NC,P]

Can you specify the URL you request and the internal URL that needs to be pulled from Tomcat.

"I simply installed ISAPI_Rewrite.dll and ISAPI_RewriteProxy.dll on IIS"
- did you install ISAPI_Rewrite manually or used automatic installation?

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

16 May 2014, 13:41

thanks for your reply.

I put those instructions and this is what I see inside rewrite.log:

init rewrite engine with requested uri /myApp/index.html
Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
Htaccess process request d:\www\.htaccess
applying pattern '^myApp/(.+)$' to uri 'myApp/index.html'
forcing proxy-throughput with http://internalIp:8080/myApp/index.html
go-ahead with proxy request http://internalIp:8080/myApp/index.html [OK]
Rewrite URL to >> /myApp/index.htmlx.rwhlp?p=0
rewrite 'myApp/index.html' -> '/myApp/index.htmlx.rwhlp?p=0'
internal redirect with /myApp/index.htmlx.rwhlp?p=0 [INTERNAL REDIRECT]

I read that ".rwhlp?p=0" doesn't affect proxy. I have dll installed only on website. I added it manually in IIS isapi filters

It seems that the internal webapp is ok, but then i got a IIS error 404 with these info:
Requested URL: http://mysite/myApp/index.htmlx.rwhlp?p=0
Physycal path: D:\www\myApp\index.htmlx.rwhlp

Thanks for your help

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with reverse proxy

19 May 2014, 08:59

Hello,

"I read that ".rwhlp?p=0" doesn't affect proxy. I have dll installed only on website. I added it manually in IIS isapi filters"
- please clarify: you have performed automatic installation of ISAPI_Rewrite and then registered ISAPI_Rewrite dlls manually for the site?
If yes, then please remove the dlls from the site setting as ISAPI_Rewrite automatically registers the dlls globally and there's no need to additionally do that.

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

19 May 2014, 09:37

I suppose the first installation was automatic (another person did that before me). But I removed the dll from iis node, so there is only one dll defined for my site now. I removed all occurrency of isapi dll from iss and then added it manually to my site node

Thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with reverse proxy

19 May 2014, 10:54

Hello,

It seems that handler for *.rwhlp file extension is not registered. Please set ISAPI_RewriteProxy.dll as ISAPI extension to handle it.

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

19 May 2014, 13:14

Now I added also ISAPI_RewriteProxy_x64.dll in IIS isapi filters. Now every url gives error 500 (I try to translate error from italian):

Impossible to call GetProcAddress on ISAPI filter "C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_RewriteProxy_x64.dll"

Thanks

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

19 May 2014, 13:48

I noticed that nowhere inside IIS "Mapping Gestori" (I think is "handler mapping" in english) I have something for *.rwhlp files

I added script mapping with request path: *.rwhlp and executable pointing to ISAPI_RewriteProxy_x64

Bu I get always the same error. I think there is something missing in IIS configuration

Thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Problem with reverse proxy

20 May 2014, 05:09

Hello,

"Impossible to call GetProcAddress on ISAPI filter "C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_RewriteProxy_x64.dll""
- this error indicated that you have registered filter to handle .rwhlp extension not handler. Please fix it.

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

20 May 2014, 06:07

Can you explain this please

thanks

User avatar
Posts: 22
Joined: 15 May 2014, 10:23

Re: Problem with reverse proxy

21 May 2014, 04:29

Solved. I had to remove proxy dll from isapi filter.

Thanks

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests