novnc-proxy fails to connect through a reverse-proxy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Triaged
|
Low
|
Unassigned |
Bug Description
Novnc-proxy will generate a URL for console access using a hard-coded empty string for the path query argument. This causes issues when exposing novnc-proxy through a reverse-proxy.
The current URL generation for novnc proxy uses the following to construct the URL:
With a novncproxy_base_url of "https:/
https:/
This URL will cause the client browser to open a websocket URL wss://host.
If https:/
Modifying the Novnc URL to include the path elements of the base_url allows the websocket to connect to the correct URL.
This URL works as expected (edited manually in the browser address bar):
https:/
I fixed this issue in my environment by patching nova/objects/
@property
def access_url(self):
if self.obj_
if self.console_type == 'novnc':
# extract file path from access_url_base
# remove the leading "/" separately to prevent an exception from occurring
# when the URL contains no path.
if raw_path[0] == "/":
# add the resulting path string before "?token" in the "path" query argument.
else:
This is the actual patch I applied to nova/objects/
21a22
> from os import path
73c74,79
< qparams = {'path': '?token=%s' % self.token}
---
> raw_path = path.dirname(
> if raw_path[0] == "/":
> path_arg = raw_path[1:]
> else:
> path_arg = raw_path
> qparams = {'path': '%s?token=%s' % (path_arg, self.token)}
@Mark: thanks for the report. Will you be able to propose a patch with you modification or should we take care of it?