You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Yan Seiner <ya...@seiner.com> on 2014/01/27 15:43:07 UTC

[users@httpd] mod_proxy and redirects

I am trying to set up a simple mod_proxy:

<VirtualHost *:80>
     ErrorLog "/var/log/apache2/wrt_error.log"
         LogLevel debug
     CustomLog "/var/log/apache2/wrt_access.log" combined

ProxyPreserveHost On
ProxyRequests Off
ServerName xxx.com
ServerAlias www.xxx.com
ProxyPass /foo/ http://localhost:8002/
ProxyPassReverse /foo/ http://localhost:8002/
</VirtualHost>

The problem I am having is that the server at localhost:8002 immediately 
issues a redirect to /cgi-bin, and I can't figure out how to handle that 
in the proxy:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/cgi-bin/yyy" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" 
href="/cgi-bin/yyy">redirected page</a>
</body>
</html>

I have several web servers at localhost:800?.  The web servers at 
localhost:800? are embedded machines so I can't easily change the code.

Any suggestions on how to proceed?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: mod_proxy and meta http-equiv=

Posted by "C.E.Rau" <s_...@hotmail.com>.
Have a look at "ProxyHTMLMeta On".

The directive enables mod_proxy_html to process the metas. (off by default) 

It's a little buggy in my testing though.

The code that trips it up is esoteric enough that you may get lucky. 

(in my case - slightly malformed metas in comments were processed - partially)

Sorry this reply didn't make it to you sooner.

 I only tripped over your post tonight, and found my own solution an hour or
 two later. 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: mod_proxy and redirects

Posted by Yan Seiner <ya...@seiner.com>.
On 01/27/2014 06:43 AM, Yan Seiner wrote:
> I am trying to set up a simple mod_proxy:
>
> <VirtualHost *:80>
>     ErrorLog "/var/log/apache2/wrt_error.log"
>         LogLevel debug
>     CustomLog "/var/log/apache2/wrt_access.log" combined
>
> ProxyPreserveHost On
> ProxyRequests Off
> ServerName xxx.com
> ServerAlias www.xxx.com
> ProxyPass /foo/ http://localhost:8002/
> ProxyPassReverse /foo/ http://localhost:8002/
> </VirtualHost>
>
> The problem I am having is that the server at localhost:8002 
> immediately issues a redirect to /cgi-bin, and I can't figure out how 
> to handle that in the proxy:
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="refresh" content="0; URL=/cgi-bin/yyy" />
> </head>
> <body style="background-color: black">
> <a style="color: white; text-decoration: none" 
> href="/cgi-bin/yyy">redirected page</a>
> </body>
> </html>
>
> I have several web servers at localhost:800?.  The web servers at 
> localhost:800? are embedded machines so I can't easily change the code.
>
> Any suggestions on how to proceed?

I should add that it works if I set up a virtual host for each 
localhost:800? machine, but that seems a bit overkill.

ProxyPass / http://localhost:8002/ <- works
ProxyPass /foo/ http://localhost:8002/ <- fails at the redirect

I want to have them accessible via

www.xxx.com/server1
www.xxx.com/server2
...

rather than having to have the overhead of

server1.xxx.com
server2.xxx.com
  and so on.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org