Skip to content
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

URL for fonts in CSS does not have the proxy-prefix #543

Open
991jo opened this issue Oct 14, 2024 · 1 comment
Open

URL for fonts in CSS does not have the proxy-prefix #543

991jo opened this issue Oct 14, 2024 · 1 comment
Labels

Comments

@991jo
Copy link

991jo commented Oct 14, 2024

gonic version: v0.16.4

I am running gonic behind a proxy with the proxy-prefix set to

proxy-prefix                /streaming/

My proxy is caddy with the following config

example.com {
        handle_path /streaming* {
                reverse_proxy http://localhost:4747
        }

        handle {
                reverse_proxy http://localhost:8080
        }
}

When I am accessing gonic in example.com/streaming/ then the CSS at https://example.com/streaming/admin/static/style.css?v=0.16.4 contains the fonts as shown in https://github.com/sentriz/gonic/blob/master/server/ctrladmin/adminui/style.css

Those URLs don't have the /streaming/ prefix and therefore are not handled by the correct handler and run into my general handler instead which can't serve them (and asks for basic auth instead, because that's what happens in that handler).

The fonts in the CSS should be prefixed with the correct proxy-prefix to load correctly with the proxy.

@991jo 991jo changed the title URL for fonts in css does not have the proxy url prefix URL for fonts in CSS does not have the proxy url prefix Oct 14, 2024
@991jo 991jo changed the title URL for fonts in CSS does not have the proxy url prefix URL for fonts in CSS does not have the proxy-prefix Oct 14, 2024
@991jo
Copy link
Author

991jo commented Oct 15, 2024

It also looks like the static fonts are not served under the proxy-prefix. They are served directly under /admin/static/inconsolata-v31-latin-600.woff2, however other static items get the prefix correctly, e.g. the header image is served from streaming/admin/static/gonic.png as it should.

I build a workaround with my proxy, extending the config a bit:

example.com {
        handle_path /streaming* {
                reverse_proxy http://localhost:4747
        }

        handle /admin* {
                reverse_proxy http://localhost:4747
        }

        handle {
                reverse_proxy http://localhost:8080
        }
}

However this now uses up the /admin path.

@sentriz sentriz added the bug label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants