Tuesday, 15 February 2011

linux - Apache - Redirect traffic from alias to port -



linux - Apache - Redirect traffic from alias to port -

ihello everyone, i'm in problem mod_rewrite in apache2

i'm trying redirect traffic incoming on localhost/music localhost:8080, i've read lot on apache documentation not find working illustration (http://httpd.apache.org/docs/2.0/misc/rewriteguide.html)

can tell me how this?

and no, i'm not trying redirect traffic tomcat (so imagine can't utilize mod_jk), want see on alias /music other app running on port 8080, it's web stream music player called cherrymusic written in python , runs html5.

i'm on debian server (precisely running raspbian on raspberry pi)

thanks in advance

in next example, if request /music/(example.mp3) redirected http status 302 http://localhost:8080/example.mp3

rewriteengine on rewriterule ^/music/(.*) http://localhost:8080/$1 [l,r=302]

in above illustration browser redirected http://localhost:8080/example.mp3 (will work cause redirected localhost)

if looking proxy request - web server connect localhost:8080 , can do:

rewriteengine on rewriterule ^/music/(.*) http://localhost:8080/$1 [l,p]

linux apache mod-rewrite

No comments:

Post a Comment