Https reverse proxy not working

Aug 1, 2010 at 12:23 AM
Edited Aug 1, 2010 at 4:15 AM

I have set up url rewriter on my IIS6 webserver and setup virtual directory m to use. So from outside network I use https://m.sample.com 

I have rewrite rule file as below

RewriteEngine On
RewriteLog "/log.txt"
RewriteLogLevel 9

# redirect to another server based upon the domain name
RewriteCond %{HTTP_HOST} ^m.sample.com
RewriteRule ^/(.*) http://internal/test/$1 [P]

The above works fine.

If I change the source to https://internal/test/$1 like below it gives error. I have posted rule and log below.

RewriteEngine On
RewriteLog "/log.txt"
RewriteLogLevel 9

# redirect to another server based upon the domain name
RewriteCond %{HTTP_HOST} ^m.sample.com
RewriteRule ^/(.*) https://internal/test/$1 [P]

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Below is the logs:

Server Error in '/' Application.

The requested url, <https://internal/test/>, could not be found.

 

 

 

2010-07-29T10:23:58 **********************************************************************************
2010-07-29T10:23:58 [Rewrite] Input: https://m.sample.com/
2010-07-29T10:23:58 [Rule 0] Input: /
2010-07-29T10:23:58 [Rule 0] Rule Pattern Matched
2010-07-29T10:23:58 [Condition 0] Input: m.sample.com
2010-07-29T10:23:58 [Condition 0]  Matched
2010-07-29T10:23:58 [Rule 0] Output: https://internal/test/
2010-07-29T10:23:58 [Rewrite] Proxy: https://internal/test/
2010-07-29T10:23:58 **********************************************************************************
2010-07-29T10:23:58 [Proxy] Request: https://internal/test/
2010-07-29T10:23:58 [Proxy] Error received from https://internal/test/: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
2010-07-29T10:23:58 [Proxy] No response was received, returning a '400 Bad Request' to the client.

**********************************************************************************

I tried redirect RewriteRule ^/(.*) https://internal/test/   [R=301,L], which only works internally.

Please help!!!

Coordinator
Aug 1, 2010 at 3:19 PM

This may be a stupid question but do you have HTTPS enabled (port 443) on that site that you are trying proxy to?

Aug 1, 2010 at 5:29 PM

Yes SSL is enabled. The site that I am trying to proxy is different machine which has iis7 running on it and ssl and port 443 is enabled.

If I point my nat to go directly to iis7 server it works fine.

Below is the scenario that does not work:

https://m.sample.com -> webserver1(iis6).sample.com (rewrite proxy) -> https://webserver2(iis7)/test/

Thanks

Coordinator
Aug 1, 2010 at 10:24 PM

Thought that might have been it, but regardless the connection to HTTPS is being blocked between the two servers.  This line in the log tells it all:

2010-07-29T10:23:58 [Proxy] Error received from https://internal/test/: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.