cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

On reverse proxy with an UrlRoot= the error page fails to load its fonts

Open jelly opened this issue 3 years ago • 2 comments

Explain what happens

Similar to this commit 62c45a95c91dc1ecfbc235a248cb30aa68d262a3 these fonts should be loaded with a relative path but not absolute.

src/common/fail.html:            src: url('/cockpit/static/fonts/RedHatDisplay-Medium.woff2') format('woff');
src/common/fail.html:            src: url('/cockpit/static/fonts/OpenSans-Light-webfont.woff') format('woff');

The question is how / where the C code in src/common/fail.html.c loads the error page.

More details: https://gist.github.com/jelly/331f26e1c7ee4580627fdd164565d74a

Version of Cockpit

270

Where is the problem in Cockpit?

No response

Server operating system

No response

Server operating system version

No response

What browsers are you using?

No response

System log

No response

jelly avatar Jun 08 '22 12:06 jelly

The tricky part here is that removing the prefix and making it absolute works for the login page, but not when you for example browser to https://cockpit.lan/system/services/notfound as that would resolve to `https://cockpit.lan/system/services/notfound/fonts/foo.woff

jelly avatar Jun 09 '22 11:06 jelly

In theory we could make the fail.html respect UrlRoot by getting the value in cockpit-ws and setting it as a template string in cockpit_web_response_error but this is a bit tricky to do.

jelly avatar Jun 09 '22 14:06 jelly