Forum Moderators: phranque
I have been working on setting up a reverse proxy with apache22.
The scenario:
[public.com...] needs to be redirected to [public.com...] which in turn is directed to [internal.local...]
I have tried proxypass/proxypassreverse and rewriterule.
The backend server is IIS.
Any help would be appreciated.
I am using the httpd-vhosts.conf file as well.
ProxyRequests Off
<VirtualHost *:80>
ServerName www.public.com
ServerAlias public.com
ProxyPreserveHost On
RewriteEngine on
RewriteRule ^/(.*)$ [public.com...] [L,R]
</VirtualHost>
<VirtualHost *:443>
ServerName www.public.com:443
SSLEngine on
SSLProxyEngine On
RequestHeader set Front-End-Https "On"
ProxyPreserveHost On
RewriteEngine on
CacheDisable *
SetEnvIf User-Agent ".*MSIE.*" value BrowserMSIE
Header unset WWW-Authenticate
Header add WWW-Authenticate "Basic realm=www.public.com"
RewriteRule ^/ [internal.local...] [P]
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/etc/apache22/extra/SSL/www.public.com.crt
SSLCertificateKeyFile /usr/local/etc/apache22/extra/SSL/myserver.key
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
And generally, most people refer to their back-end server using its local IP address instead of a domain name (as long as the back-end *is* on the local network). So, we usually see rules like
RewriteRule ^/(.*)$ http://192.168.0.3/$1 [P] Jim
Thanks for your help. I have tried the following:
RewriteRule ^/(.*)$ [192.168.0.3...] [P] and it still went to the default website.
So then I tried:
RewriteRule ^/(.*)$ [192.168.0.3...] [P] and it loads the page, but it adds an extra /sdc/ to the menu links and looks like /sdc/sdc/page.aspx. Heh.
I have the website setup as both a virtual directory 192.168.0.3/sdc and as website www.internal.local mapped to the same directory and have tried both ways. I should also mention it is not the default website on the IIS server as there are a few websites hosted from this server internally. We also have third party software that can only install in the default website of IIS. Frustrating...
Gerry.
Did you try the other suggestion -- adding a trailing slash to the domain name?
RewriteRule ^/(.*)$ http://www.internal.loc[b]al/[/b]$1 [P]
Again, this may not help but even it it doesn't, at least you can cross it off the list of possible problems... :)
Jim
Sorry yes I had also tried:
RewriteRule ^/(.*)$ [internal.local...] [P]
and just for kicks
RewriteRule ^/(.*)$ [internal.local...] [P]
Gerry