You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Al <sh...@yahoo.com> on 2011/02/20 00:49:08 UTC

[users@httpd] Couple of questions about rewrite and proxypass

Hi,
   i am trying to get http binding to work for jwchat and openfire and i found some examples and would like to make sure i understand couple of things:

<VirtualHost *>

  ServerName myserver.com
  DocumentRoot "C:/apache2/htdocs/"

  <Directory "C:/apache2/htdocs/">
  Options  +Indexes +MultiViews

  </Directory>

  AddDefaultCharset UTF-8

  RewriteEngine on

  RewriteRule http-bind/ http://myserver.com/http-bind/

</VirtualHost>
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/ 

So what RewriteRule here is doing is when it detects "http-bind/" it will direct me to "http://myserver.com/http-bind/"? and when ProxyPass detects the "/http-bind/" it will try to direct me to "http://127.0.0.1:8080/http-bind/" ?

couple of questions...
1. when I entered "http://myserver.com/http-bind/" i ended up in the same URL though - is that what should happen?

2. is RewrieRule neccessary here? if i just enter http://myserver.com/http-bind/ directly wouldnt it bypass it? I am a bit confused here..

thanks...





      

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


Re: [users@httpd] Couple of questions about rewrite and proxypass

Posted by Al <sh...@yahoo.com>.
Nick,
   what would that RewriteRule coupled with the proxypass do? 
With proxypass you said if my application is there - so 
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/ 

means when I go on myserver.com/http-bind/ it will redirect me to http:127.0... right? 

--- On Sun, 2/20/11, Nick Kew <ni...@webthing.com> wrote:

> From: Nick Kew <ni...@webthing.com>
> Subject: Re: [users@httpd] Couple of questions about rewrite and proxypass
> To: users@httpd.apache.org
> Date: Sunday, February 20, 2011, 4:47 AM
> 
> On 19 Feb 2011, at 23:49, Al wrote:
> 
> >  RewriteEngine on
> > 
> >  RewriteRule http-bind/ http://myserver.com/http-bind/
> 
> WTF are you trying to do there?
> 
> > </VirtualHost>
> > ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/ 
> 
> Now that makes sense (if your app is there), though perhaps
> you meant to put it
> inside  the virtualhost.  You may need something
> more, but whatever you need
> it's not mod_rewrite!
> 
> -- 
> Nick Kew
> 
> Available for work, contract or permanent
> http://www.webthing.com/~nick/cv.html
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 


      

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


Re: [users@httpd] Couple of questions about rewrite and proxypass

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> 
> On 19 Feb 2011, at 23:49, Al wrote:
> 
> >  RewriteEngine on
> > 
> >  RewriteRule http-bind/ http://myserver.com/http-bind/
> 
> WTF are you trying to do there?

Heh. niq is so shocked, he forgot to link his own manual:

http://www.apachetutor.org/admin/reverseproxies

> > </VirtualHost>
> > ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/
> 
> Now that makes sense (if your app is there), though perhaps you meant
> to put it
> inside  the virtualhost.  You may need something more, but whatever
> you need it's not mod_rewrite!

I don't think that can be repeated often enough ;)

http://wiki.apache.org/httpd/WhenNotToUseRewrite
And (the probably more complete):
http://httpd.apache.org/docs/trunk/rewrite/avoid.html

> --
> Nick Kew
> 
> Available for work, contract or permanent
> http://www.webthing.com/~nick/cv.html

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

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


Re: [users@httpd] Couple of questions about rewrite and proxypass

Posted by Nick Kew <ni...@webthing.com>.
On 19 Feb 2011, at 23:49, Al wrote:

>  RewriteEngine on
> 
>  RewriteRule http-bind/ http://myserver.com/http-bind/

WTF are you trying to do there?

> </VirtualHost>
> ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/ 

Now that makes sense (if your app is there), though perhaps you meant to put it
inside  the virtualhost.  You may need something more, but whatever you need
it's not mod_rewrite!

-- 
Nick Kew

Available for work, contract or permanent
http://www.webthing.com/~nick/cv.html


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