httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Karakashian <tkarakash...@gmail.com>
Subject [users@httpd] Reverse proxy not working
Date Wed, 23 Feb 2005 03:18:19 GMT
I've driven myself crazy for the last few days, and searches have
gotten me nowhere.  Help, please. :)

My home environment:

internal.mydomain.com     192.168.0.1
owa.mydomain.com          192.168.0.2
wireless.mydomain.com    192.168.0.3
external.mydomain.com    10.0.0.1 (this is representative of the
external IP of the router)

The internal machine is the primary webserver running Apache 2.0.52. 
External is the firewall/router running Linux and port-forwarding port
443 back to the internal webserver.  owa is my Exchange 2003 server. 
wireless is my WAP.  The goal is to have internal dole out pages
excepting /exchange which will be proxied from the Exchange server. 
Pages from /wireless should be proxied from the WAP's control pages.

I'm including my entire conf, as I've found a couple of solutions here
and there and they usually only have the "relevant" parts, but I'm
going to include the whole thing in case I'm missing anything (like a
module).  I've removed pretty much but a most basic configuration,
I'll add the other stuff back in later.

Now, I've done this in the past, when I had Apache running on the
firewall acting as a reverse proxy for everything inside.  However, a
similar config is just refusing to work for me right now (the old
proxy was also 2.0.52).  For the relevant parts:

RewriteEngine On
RewriteLogLevel 30
RewriteLog logs/rewrite.log
RewriteRule ^/exchange/(.*) http://192.168.0.1/exchange/$1 [P]
RewriteRule ^/public/(.*) http://192.168.0.1/public/$1 [P]
RewriteRule ^/exchweb/(.*) http://192.168.0.1/exchweb/$1 [P]
RewriteRule ^/wireless/(.*) http://192.168.0.3/$1 [P]

The last line is duplicated from my original config, and worked in the
past.  However, now, when I attempt to access one of the proxied
pages, I get the internal IP of the server, rather than the proper
URL.  So, for example, I can't access /wireless from the outside since
it's not a valid address.

The rewrite log seems to indicate the proxy is working as it should:

init rewrite engine with requested uri /exchange/
applying pattern '^/exchange/(.*)' to uri '/exchange/'
rewrite /exchange/ -> http://192.168.0.1/exchange/
forcing proxy-throughput with http://192.168.0.1/exchange/
go-ahead with proxy request proxy:http://192.168.0.1/exchange/ [OK]

But, it's not proxying, it's just rewriting the URL and returning it
to the client.

Any suggestions?

Thanks in advance,

-T

ServerRoot "/usr"
PidFile /var/run/httpd.pid
Timeout 300
KeepAlive On
Listen 443
User apache
Group apache
ServerAdmin webmaster@mydomain.com

UseCanonicalName Off
DocumentRoot "apache/htdocs/"
ServerTokens Prod
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache none
SSLVerifyClient none
CheckSpelling On

LoadModule access_module lib/apache/mod_access.so 
LoadModule include_module lib/apache/mod_include.so 
LoadModule log_config_module lib/apache/mod_log_config.so 
LoadModule mime_magic_module lib/apache/mod_mime_magic.so 
LoadModule unique_id_module lib/apache/mod_unique_id.so 
LoadModule proxy_module lib/apache/mod_proxy.so 
LoadModule proxy_connect_module lib/apache/mod_proxy_connect.so 
LoadModule proxy_ftp_module lib/apache/mod_proxy_ftp.so 
LoadModule proxy_http_module lib/apache/mod_proxy_http.so 
LoadModule ssl_module lib/apache/mod_ssl.so 
LoadModule mime_module lib/apache/mod_mime.so 
LoadModule negotiation_module lib/apache/mod_negotiation.so 
LoadModule dir_module lib/apache/mod_dir.so 
LoadModule speling_module lib/apache/mod_speling.so 
LoadModule userdir_module lib/apache/mod_userdir.so 
LoadModule alias_module lib/apache/mod_alias.so 
LoadModule php5_module lib/apache/libphp5.so
LoadModule headers_module lib/apache/mod_headers.so
LoadModule rewrite_module lib/apache/mod_rewrite.so

DirectoryIndex index.html index.php

AccessFileName .htaccess

TypesConfig conf/mime.types
DefaultType text/plain
MIMEMagicFile conf/magic
HostnameLookups Off
EnableMMAP off
EnableSendfile On

ErrorLog /error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"\"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common 
LogFormat "%{Referer}i -> %U" referer 
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common 

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php

SSLEngine on
ServerName external.mydomain.com
# I'm using the same name internally and externally on my laptop.  I'm
using some DNS
# fiddling to point to the right machine

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile newcert.pem
SSLCertificateKeyFile nopass.key
SSLCACertificateFile cacert.pem
SSLCARevocationPath crl

RewriteEngine On
RewriteLogLevel 30
RewriteLog /home/apache/logs/rewrite.log
RewriteRule ^/exchange/(.*) http://192.168.0.1/exchange/$1 [P]
RewriteRule ^/public/(.*) http://192.168.0.1/public/$1 [P]
RewriteRule ^/exchweb/(.*) http://192.168.01/exchweb/$1 [P]
RewriteRule ^/wireless/(.*) http://192.168.0.3/$1 [P]
ProxyRequests Off

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message