Plone 5.2 Icons not shown under virtual hosting

If I do virtual hosting using plone, I can't map a directory different than the plone named directory, otherwise, the icons on the navigation tree will not be shown.

I see the problem do not appear on others components that use the mime type icon, let me explain:

In :

<img class="mime-icon" tal:condition="python:item_type =='File' and not supress_icon"
                       tal:attributes="href node/getURL;
                                       src python:view.getMimeTypeIcon(node);">

This above will not work under virtual hosting, the URL will always be the Absolute URL, like:

src="/portal/++resource++mimetype.icons/pdf.png" />

While :

<img tal:attributes="src view/get_mimetype_icon;
                     alt content_type;" border="0" /

    def get_mimetype_icon(self):
        return super(FileView, self).getMimeTypeIcon(self.context.file)

Will work ok, and shows:


I access the website throught , so: in order to fix the above, I decided to rename /Plone to /portal and in this way I will have a 1:1 mapping, however, doing that broke all the plone.global_sections that appears to be hardcoded.

At the end I undo the above and created a new website under '/portal' and that is one solution, but not the solution that fixes the problem.

This is a host relative url. It works with the most important kind of virtual hosting (when there is no need to put in additional url components). But, of course, the view should generate a full absolute url, ready for general virtual hosting support.

This is a relative url. It is usually not optimal to access static resources via this kind of urls - as HTTP caching is made less efficient.

You may consider filing bug reports.
You might be able to change your virtual hosting (avoiding _vh_ url components).

I will try to remove the _vh_ configuration from nginx, well, anyway, for now it works, later I will try to find a better solution.

FYI this is the line that to the transfer to uwsgi:

rewrite "^/portal($|\/$.|\/.*)$" "/VirtualHostBase/https/$server_name:$server_port/portal/VirtualHostRoot/_vh_portal$1" break;

As far as I now, renaming the Plone root object is not supported officially as it is internally the almost the same as a copy and paste, which is not supported either. But correct me if I am wrong.