You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Noor Mohammad <ba...@gmail.com> on 2017/12/31 09:25:32 UTC

[users@httpd] Reverse proxy not working

I have an application correctly working on locahost:8080 and I am setting
up a reverse proxy as follows but on a remote browser, when using the
proxy, i am getting local links as if apache is ignoring the reverse proxy.
The definition of the proxy is as follows:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyPreserveHost On
ProxyPass /marmotta/ http://localhost:8080/marmotta/
ProxyPassReverse /marmotta/ http://localhost:8080/marmotta/


Any idea why this is not working ?



‌

Re: [users@httpd] Reverse proxy not working

Posted by Yann Ylavic <yl...@gmail.com>.
On Tue, Jan 2, 2018 at 1:05 PM, Simon Walter <si...@gikaku.com> wrote:
> On 01/02/2018 06:06 PM, Luca Toscano wrote:
>>
>> Can you explain a bit more what do you mean with "I am getting local
>> links" ?
>
> I think Noor is expecting mod_proxy to modify the HTML. I might be
> wrong, but IIRC that is not what mod_proxy does.
>
[snip]
>
> Noor, I think you will need to form your URLs as they should appear to
> the final client.

The URLs created by the application (origin server) should be
relative, no preceeding scheme nor domain:port like
"http://localhost:8080", but paths only (e.g. HTML links should look
like '<img src="/marmotta/foo.gif" ... />' instead of '<img
src="http://localhost:8080/marmotta/foo.gif" ... />').

Another possibility, if you can't change the application, is to use
mod_proxy_html to rewrite the URLs, but it's less easy...


Regards,
Yann.

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


Re: [users@httpd] Reverse proxy not working

Posted by Simon Walter <si...@gikaku.com>.
On 01/02/2018 06:06 PM, Luca Toscano wrote:
> Hi,
> 
> 2017-12-31 10:25 GMT+01:00 Noor Mohammad <bakenoor.uk@gmail.com
> <ma...@gmail.com>>:
> 
>     I have an application correctly working on locahost:8080 and I am
>     setting up a reverse proxy as follows but on a remote browser, when
>     using the proxy, i am getting local links as if apache is ignoring
>     the reverse proxy. The definition of the proxy is as follows:
> 
>     LoadModule proxy_module modules/mod_proxy.so
>     LoadModule proxy_http_module modules/mod_proxy_http.so
>     ProxyPreserveHost On
>     ProxyPass /marmotta/ http://localhost:8080/marmotta/
>     <http://localhost:8080/marmotta/>
>     ProxyPassReverse /marmotta/ http://localhost:8080/marmotta/
>     <http://localhost:8080/marmotta/>
> 
> 
>     Any idea why this is not working ?
> 
> 
> Can you explain a bit more what do you mean with "I am getting local
> links" ? 

I think Noor is expecting mod_proxy to modify the HTML. I might be
wrong, but IIRC that is not what mod_proxy does.

"A typical usage of a forward proxy is to provide Internet access to
internal clients that are otherwise restricted by a firewall. The
forward proxy can also use caching (as provided by mod_cache) to reduce
network usage."

"A typical usage of a reverse proxy is to provide Internet users access
to a server that is behind a firewall. Reverse proxies can also be used
to balance load among several back-end servers or to provide caching for
a slower back-end server. In addition, reverse proxies can be used
simply to bring several servers into the same URL space."

https://httpd.apache.org/docs/current/mod/mod_proxy.html

Noor, I think you will need to form your URLs as they should appear to
the final client.

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


Re: [users@httpd] Reverse proxy not working

Posted by Luca Toscano <to...@gmail.com>.
Hi,

2017-12-31 10:25 GMT+01:00 Noor Mohammad <ba...@gmail.com>:

> I have an application correctly working on locahost:8080 and I am setting
> up a reverse proxy as follows but on a remote browser, when using the
> proxy, i am getting local links as if apache is ignoring the reverse proxy.
> The definition of the proxy is as follows:
>
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule proxy_http_module modules/mod_proxy_http.so
> ProxyPreserveHost On
> ProxyPass /marmotta/ http://localhost:8080/marmotta/
> ProxyPassReverse /marmotta/ http://localhost:8080/marmotta/
>
>
> Any idea why this is not working ?
>

Can you explain a bit more what do you mean with "I am getting local links"
?