New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiles did not work with reverse proxy configured to multiple sites #59
Comments
Just to be aware, I know of someone here in Seattle who has seen a similar problem. Tiles in a site using vh parameters in a virtual hosting setup failing to render. The issue appears to be related to the presence of the vh stuff in the proxy URL. It appears it may be a bug in the subrequest package. I think there is an issue already open, but you might start looking there. |
you mean the plone.subrequest package? could you please provide a link for the bug report, @cewing ? |
@hvelarde I do mean that. I just asked, and there is no bug report open yet. But here's the line where it happens: https://github.com/plone/plone.subrequest/blob/master/plone/subrequest/__init__.py#L73 according to my friend up here, the vh bits are not removed properly in handling vurl_parts in the lines immediately preceding that one. Drop a breakpoint there and he says you'll see the problem. |
I'm analyzed the problem is not in subrequest, but as we are passing the url eg: Call subrequest(url), it returns a response object. >>> from plone.subrequest import subrequest
>>> response = subrequest('/folder1/@@url')
>>> response.getBody()
'http://nohost/folder1' The sample above show a basic usage, an observation in the passed url, is relative url and not absolute. View documentation here: http://pypi.python.org/pypi/plone.subrequest/ The soluction is in pull request #60 ;) |
I think this just routes around the problem, which is in subrequest. vhost urls are not properly handled there if they have vh elements in them |
But see, in the tests are planned vhost urls , i ran these tests and passed. :-$ https://github.com/plone/plone.subrequest/blob/master/plone/subrequest/tests.py#L30 |
I'm the guy who ran into similar problems with plone.subrequest when using vh. I also found the apparently thorough test suite intimidating, but I'm not convinced the relatively common way I'm using vh in my rewrite rule is actually covered by the tests. I will spend a bit of time investigating this evening. |
Okay, we've resolved locally why this isn't working in the vh use case with a full site url. The issue is that a subrequest is resolved entirely through zope traversal, not through a request to Apache. Therefore, VH rewrites at the proxy level never occur, and the URL passed to the subrequest is just wrong. The lesson we've learned here is that with tiles it might be better to think of the 'url' you are providing as the data-tile attribute more as a traversal path and less as a URL. Sorry for clouding the issue for you all. Putting this here so there's a record of the full resolution of the issue |
It seems to me that problem's in the form that we pass url to subrequest, if in the data-tile we pass correct url (eg: /VirtualHostBase/http/www.cleberjsantos.com,.br:80/otherplone/VirtualHostRoot/_vh_subplone/) pass without problem, but the Plone is behind the Web server and perhaps the subrequest would have to be able to understand that. |
I don't have much experience with virtual hosts and proxies, but I have just cloned your fork and everything seems to be working fine, also tests are passing ok, so, if this fixes the issue and doesn't introduce any (known) bug, i would say it's a +1 from me |
If we're working with reverse proxy and multiple sites plone and our configuration is like the example below, have problems with viewing.
Reproduce the error.
Configure an webserver eg: Nginx
First, go directly to the instance and add a cover, then we'll open the two Plone sites in the browser
Until the second step we have no problem, now we access the Plone sites through the Nginx server.
Trace back
The text was updated successfully, but these errors were encountered: