httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m <ma...@ftsi.fujitsu.com>
Subject [users@httpd] RewriteRule and ProxyPass in Same VirtualHost??
Date Thu, 03 Jul 2003 22:00:11 GMT
hi,

I first posted this question a couple of days ago.  I have two virtual hosts, one configured
to listen to http, 
the other to listen on port 443 for https. 

I am using proxypass and proxyreversepass directives as well.  I'd now like to run some of
my jsp through http
and some through https, so I posted my question. No one got back to me, so I figured this
was so basic that I have 
just missed something.  Well I have been spinning my wheels on it for two days now, why can't
I get it to work??

I can get everything to go directly to https  with the RewriteCond  directive, only by eliminating
my proxying directives.
So, can use RewriteCond, RewriteRule and the proxying directives together.  I haven't found
an example of this on the web.

Any help is greatly appreciated.  Original message attached

M



I have installed Apache 2.0.46 with OpenSSL 0.9.7b. I have installed my 
test certificate, and Id now like to configure my site so that certain 
pages, e.g. login are served up with https, but the majority are served 
up with http.

I have configured two virtual hosts, one in httpd.conf to listen on port 
80, the other in ssl.conf to listen on 443. So far I can access my site 
through both https and http, so to me, that means both virtual hosts are 
working. (I am using proxypass and proxyreversepass in the virtual hosts).

Now Id like to start being selective. To get the ball rolling I thought 
Id put a simple condition in to serve everything as https, using 
RewriteCond and RewriteRule. Nothing happens! I have included the full 
virtual hosts below, (though I have removed the IP addresses). Nothing 
gets written to the rewrite_log

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]



<VirtualHost xxx.xxx.xxx.xxx:80>

ProxyPass /fts_patch_errors !

RewriteEngine on

RewriteLog /var/apache/logs/rewrite_log
RewriteLogLevel 5

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]

ProxyPass /portal-uat/fts http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat/fts/ 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat/ftsadmin 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin
ProxyPassReverse /portal-uat/ftsadmin/ 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin/

ProxyPass / http://avanti.eng.mydomain.com:2080/portal3/fts/
ProxyPassReverse / http://avanti.eng.mydomain.com:2080/portal3/fts/


# Directertory for HTML Error docs
<Directory "/export/home/http/htdocs/silverstream">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


# Alias pointing to Error Docs Directory
Alias /fts_patch_errors/ "/export/home/http/htdocs/silverstream/"

# Error Document Directive
ErrorDocument 502 /fts_patch_errors/HTTP_BAD_GATEWAY.html

</VirtualHost>



<VirtualHost xxx.xxx.xxx.xxx:443>


SSLEngine on
SSLCipherSuite 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/certificates/server.crt
SSLCertificateKeyFile /usr/local/certificates/server.key

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

ErrorLog /var/apache/logs/error_log
TransferLog /var/apache/logs/access_log
CustomLog /var/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


ProxyPass /fts_patch_errors !

ProxyPass /portal-uat/fts http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat/fts/ 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat/ftsadmin 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin
ProxyPassReverse /portal-uat/ftsadmin/ 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin/

ProxyPass / http://avanti.eng.mydomain.com:2080/portal3/fts/
ProxyPassReverse / http://avanti.eng.mydomain.com:2080/portal3/fts/

# Directertory for HTML Error docs
<Directory "/export/home/http/htdocs/silverstream">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# Alias pointing to Error Docs Directory
Alias /fts_patch_errors/ "/export/home/http/htdocs/silverstream/"

# Error Document Directive
ErrorDocument 502 /fts_patch_errors/HTTP_BAD_GATEWAY.html
</VirtualHost>



---------------------------------------------------------------------
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