Wrong version URL when Glance is deployed behind proxy with vhost

Bug #1823703 reported by s10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Unassigned

Bug Description

When Glance is deployed behind SSL terminating proxy, for example, as https://cloud.example.com/image the href returned in version doc is missing the vhost - https://cloud.example.com/v2

How to reproduce:
1. Run Glance behind proxy with vhost as https://cloud.example.com/image and pass host, X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Prefix headers
2. Remove DEFAULT/public_endpoint option from the config
3. Enable HTTPProxyToWSGI: oslo_middleware/enable_proxy_headers_parsing=True
4. curl https://cloud.example.com/image

Actual result:
https://cloud.example.com/v2/ in all hrefs

Expected result:
https://cloud.example.com/image/v2/ in all hrefs

Glance version: Queens

s10 (vlad-esten)
description: updated
Revision history for this message
s10 (vlad-esten) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/650879
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=33626369e591b03eb75c44b5c45c7969c7cb40e9
Submitter: Zuul
Branch: master

commit 33626369e591b03eb75c44b5c45c7969c7cb40e9
Author: Vlad Gusev <email address hidden>
Date: Mon Apr 8 15:49:16 2019 +0300

    Use application_url in API version document

    This handles the possible vhost in Glance API path correctly
    (like https://cloud.example.com/image) contrary to host_url.

    Change-Id: If86d805ddc46944e3aa2785aa5d775fe15b8468c
    Closes-Bug: #1823703

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/717716

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 20.0.0.0b3

This issue was fixed in the openstack/glance 20.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/train)

Change abandoned by "Abhishek Kekane <email address hidden>" on branch: stable/train
Review: https://review.opendev.org/c/openstack/glance/+/717716
Reason: This does not fit with our backport criteria [0]

[0] https://docs.openstack.org/project-team-guide/stable-branches.html#appropriate-fixes

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.