Reverse proxy fail

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 12 Jul 2012, 20:52

Reverse proxy fail

12 Jul 2012, 21:58

I have one internet server (DMZ) running IIS 6 and other server on internal network providing service on port 5443.
The DMZ server has connection to the internal server to the port 5443 (telnet 5443 returns fine).
Also, I tested on browser of DMZ server the access to the internal service and it returned fine.
Now, I need to provide access to the internet users to this service.
More Details :
The internet user will put the hit (after the configuration works properly) : https://corporate.mycompany.com/invoke/getEnvironment
Currently the INTERNAL user put the follow hit on internal network and is running fine : https://myservername.iac.net:5443/invoke/getEnvironment
I have configured below but IS NOT working properly. I'm getting 404 http code.
Can anyone suggest any help ?
================================================
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.89
RewriteEngine on
RewriteBase /
RewriteProxy (invoke/.*) https://myservername.iac.net:5443/$1 [H,A,L]
================================================

Rewrite.log
(2) init rewrite engine with requested uri /invoke/getEnvironment
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '(invoke/.*)' to uri 'invoke/getEnvironment'
(2) forcing proxy-throughput with https://myservername.iac.net:5443/invoke/getEnvironment
(1) go-ahead with proxy request https://myservername.iac.net:5443/invoke/getEnvironment [OK]
(1) Rewrite URL to >> /invoke/getEnvironmentx.rwhlp?p=48
(2) rewrite 'invoke/getEnvironment' -> '/invoke/getEnvironmentx.rwhlp?p=48'
(2) internal redirect with /invoke/getEnvironmentx.rwhlp?p=48 [INTERNAL REDIRECT]

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Reverse proxy fail

13 Jul 2012, 06:39

Hello,

Lets check if Proxy is working correctly, as first.
Try using the testing rule like:

Code: Select all
RewriteProxy test$ http://www.google.co.uk [L]


See if it's gonna give you google page.

You may also try to remove H-flag as this could be an issue.

Regards
Andrew

User avatar
Posts: 3
Joined: 12 Jul 2012, 20:52

Re: Reverse proxy fail

13 Jul 2012, 15:40

Andrew,
In order to try to understand how reverse proxy works, I decided to use an internal server as role of DMZ server before to move to real DMZ. Then I put the code :
Code: Select all
RewriteEngine on
RewriteBase /
RewriteProxy (invoke/.*) https://myserver.iac.net:5443/$1 [L]

and I received Internal Server error whilst if I use the code
Code: Select all
RewriteRule (invoke/.*) https://myserver.iac.net:5443/$1 [L]
it process the request but the name of host server presented on browser move to myserver.iac.net instead of remains to original server called on hit,
and we know, this can not work on real DMZ environment.
Sample :
The user hit : https://original.iac.net/invoke/getEnvironment
move on browser to https://myserver.iac.net:5443/invoke/getEnvironment.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Reverse proxy fail

16 Jul 2012, 07:04

Not sure I understand the point

User avatar
Posts: 3
Joined: 12 Jul 2012, 20:52

Re: Reverse proxy fail

23 Jul 2012, 15:46

The procedure below fix this problem. After that the reverse proxy run fine.

1. Properties of Internet Information Services (IIS) Manager
2. Click MIME Types
3. Click New
4. Type .rwhlp on field Extension and type "Isapi_rewrite_installation_Path"\ISAPI_RewriteProxy.dll on MIME type field.
5. Click OK. Click OK. Click OK.
6. Right click on Internet Information Services (IIS) Manager, All Tasks, Save Configuration to disk.
7. Restart IIS.
8. End of procedure.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 8 guests