cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
10.98k stars 1.1k forks source link

Multiple Subdirs in cockpit.conf UrlRoot #18452

Open bitdruid opened 1 year ago

bitdruid commented 1 year ago

I ran into an issue with a reverse proxy and multiple subdirs

whereas its working fine with

[WebService]
Origins=https://example.cloud/ wss://example.cloud/
UrlRoot=/kvm-cockpit/
ProtocolHeader = X-Forwarded-Proto
ForwardedForHeader = X-Forwarded-For

and an according nginx conf you will always be redirected to ip:port with NOT FOUND when multiple subdirs are used:

[WebService]
Origins=https://example.cloud/ wss://example.cloud/
UrlRoot=/internals/kvm-cockpit/
ProtocolHeader = X-Forwarded-Proto
ForwardedForHeader = X-Forwarded-For

dont know if i missed a detail or would there be the possibility for an enhancement to support multiple subdirs?

jelly commented 1 year ago

If I understand you correctly, you have two different /etc/cockpit.d/ configuration snippets?

bitdruid commented 1 year ago

If I understand you correctly, you have two different /etc/cockpit.d/ configuration snippets?

no sorry if i wasnt clear enough

i have one domain example.com there is a restricted area in example.com/internals and cockpit is running with a reverse proxy in example.com/internals/kvm-cockpit/

to clear out any missconfiguration by me i placed cockpit (for test purpose) to example.com/kvm-cockpit/, changed Origins and rootUrl in the cockpit.conf and it was reachable however it is not reachable under example.com/internals/kvm-cockpit/

my assumption was, that cockpit cant handle multiple subdirs. or are there some details in the configuration to be different which i am missing?