Author |
|
Rotor
Joined: 28 Oct 2014 Posts: 9 Location: France,lyon
|
Posted: Tue 28 Oct '14 16:30 Post subject: rewriterule does redirect rather than proxy |
|
|
Hello,
I just installed httpd-2.4.10-win32 and I can't make mod_rewrite to work :
What I'd want is a proxy to receive a print.xxxx.com/appl uri and forwards to appl.serveur.xxxx.com:8080/streammaster
I do
RewriteCond %{HTTP_HOST} print.xxxx.com
RewriteRule /appl/ http://appl.serveur.xxxx.com:8080/streammaster [P]
and I get a redirect : 192.168.250.50 - - [28/Oct/2014:14:55:19 +0100] "GET /appl/ HTTP/1.1" 302 -
mod_proxy is loaded and works of course.
I've tried lot of variations (it works the same in a virtual host without rewritecond) to no avail. I must be doing something wrong but what?
Thanks! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 28 Oct '14 17:17 Post subject: |
|
|
You should use a reverse proxy inside your vhost instead the rewrite rule
<VirtualHost *:80>
ServerName print.xxxx.com
DocumentRoot "/mario/Apache22/htdocs"
<Directory "/mario/Apache22/htdocs">
Options Indexes Includes FollowSymLinks
AllowOverride None
Require All granted
</Directory>
<Location /appl/>
ProxyPass http://appl.serveur.xxxx.com:8080/streammaster/
ProxyPassReverse http://appl.serveur.xxxx.com:8080/streammaster/
</Location>
</virtualhost> |
|
Back to top |
|
Rotor
Joined: 28 Oct 2014 Posts: 9 Location: France,lyon
|
Posted: Tue 28 Oct '14 18:06 Post subject: |
|
|
Thanks but now I get the "redirection loop" (below).
There's really a problem with this specific "surgery" and I begin to think that it can't be done with a "classical" proxy configuration.
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 -
192.168.250.50 - - [28/Oct/2014:17:02:05 +0100] "GET /esi// HTTP/1.1" 302 - |
|
Back to top |
|
Rotor
Joined: 28 Oct 2014 Posts: 9 Location: France,lyon
|
Posted: Wed 29 Oct '14 12:20 Post subject: |
|
|
Ooops, in fact your solution worked but there was a second problem because of links in the page. Thanks again for the quick help! |
|
Back to top |
|
jraute
Joined: 13 Sep 2013 Posts: 188 Location: Rheinland, Germany
|
Posted: Wed 29 Oct '14 14:20 Post subject: |
|
|
Did you use mod_proxy_html?
"This module provides an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. It serves the same purpose as Apache's ProxyPassReverse directive does for HTTP headers, and is an essential component of a reverse proxy." (see also http://httpd.apache.org/docs/current/mod/mod_proxy_html.html) |
|
Back to top |
|