[Zope] zope behind apache reverse proxy css and images broken using eduCommons

Tapas Mishra mightydreams at gmail.com
Wed Jun 9 01:18:42 EDT 2010


Hi,
I am running a website in a format
http://ocw.mydomain.com
where only http://mydomain.com has public IP.
It is running on Apache.

Now I configured a reverse proxy to be able to reach the server where
ocw.openitup.in is hosted on Zope
what is happening is
 request which is coming to a domain ocw.mydomain.com

first reaches the server  mydomain.com (which has a public IP).


Then is being forwarded internally to where ocw is present like this

           URL_A/VirtualHostBase/http/URL_B/VirtualHostRoot/eduCommons

i.e. Apache at mydomain.com contains

ProxyPass   URL_A/VirtualHostBase/http/URL_B/VirtualHostRoot/eduCommons
ProxyPassReverse   URL_A/VirtualHostBase/http/URL_B/VirtualHostRoot/eduCommons


where URL_A is internal IP of machine where the site is hosted for a
request to be able to reach Zope

Zope documentation page says it should have VirtualHostBase and
VirtualHostRoot as its path elements.
Which in above format I have done.

But if some one opens the domain

http://ocw.mydomain.com

then the CSS which is getting loaded in browser when I click view source

it shows

a href="URL_B/eduCommons/path/to/CSS"

URL_B is internal IP of server where eduCommons is running.

Note that in a users browser on internet it does not show URL_A that means that
request coming from internet has been able to reach
what ever URL_A means in above directives.

I have checked it by replacing with hostname of server on which it is running.
The CSS does not loads.

If I use hostname instead of URL_B then

http://ocw.mydomain.com

tries to load CSS, Javascrips and images from

href="http://Hostname_B/eduCommons/path/to/CSS"

now Hostname_B is also known only to then computers which are in my LAN.

Any request  on internet does know any thing about it.

I checked replacing Hostname_B with

 ocw.mydomain.com even then
the broken element in page source shows it is trying to fetch the
CSS,Javascript or images from

href="ocw.mydomain.com/eduCommons"

the above URL is in page source when client browser tries to load
CSS,Javascript or image on internet.


So what is happening is in the reverse proxy server

which is the first place where the request are coming
it is forwarded internally as

URL_A/VirtualHostBase/http/URL_B/VirtualHostRoot/eduCommons

what ever is present in place of URL_B that the client browser on
internet is trying to load which obviously is not present.



I have also checked by replacing URL_B with URL_A
i.e.


ProxyPass   URL_A/VirtualHostBase/http/URL_A/VirtualHostRoot/eduCommons
ProxyPassReverse   URL_A/VirtualHostBase/http/URL_A/VirtualHostRoot/eduCommons

then on a client browser on internet the CSS is being loaded from

URL_A/eduCommons/path/to/CSS
where URL A is again only known to my LAN and in above ProxyPass
Directive it is taken from second occurrence of URL_A

This URL_A string which some one is getting in a client browser on
internet is again internal IP of my machine where I hosted EduCommons.


-- 
Tapas


More information about the Zope mailing list