diff --git a/doc/source/configuring.rst b/doc/source/configuring.rst index 17a7ae4c5c..976802b66d 100644 --- a/doc/source/configuring.rst +++ b/doc/source/configuring.rst @@ -1331,3 +1331,15 @@ glance-registry service separately, by default they place at to make profiling work as designed operator needs to make those values of HMAC key be consistent for all services in your deployment. Without HMAC key the profiling will not be triggered even profiling feature is enabled. + +Configuring Glance public endpoint +---------------------------------- + +When Glance API service is ran dehind a proxy, operator probably need to +configure a proper public endpoint to versions URL instead of use host owned +which run service really. Glance allows configure a public endpoint URL to +represent the proxy's URL. + +* ``public_endpoint=`` + +Optional. Default: ``None`` diff --git a/etc/glance-api.conf b/etc/glance-api.conf index 5016d24dbd..cc31868f11 100644 --- a/etc/glance-api.conf +++ b/etc/glance-api.conf @@ -109,6 +109,13 @@ backlog = 4096 # and 'store_type'. #location_strategy = location_order + +# Public url to use for versions endpoint. The default is None, +# which will use the request's host_url attribute to populate the URL base. +# If Glance is operating behind a proxy, you will want to change this to +# represent the proxy's URL. +#public_endpoint= + # ================= Syslog Options ============================ # Send logs to syslog (/dev/log) instead of to file specified diff --git a/glance/opts.py b/glance/opts.py index 0acd125e6a..96f30b968b 100644 --- a/glance/opts.py +++ b/glance/opts.py @@ -25,6 +25,7 @@ import itertools import glance.api.middleware.context import glance.api.policy +import glance.api.versions import glance.common.config import glance.common.location_strategy import glance.common.location_strategy.store_type @@ -55,6 +56,7 @@ _api_opts = [ (None, list(itertools.chain(*(_global_opt_lists + [ glance.api.middleware.context.context_opts, glance.api.policy.policy_opts, + glance.api.versions.versions_opts, glance.common.config.common_opts, glance.common.location_strategy.location_strategy_opts, glance.common.property_utils.property_opts, diff --git a/glance/tests/unit/test_opts.py b/glance/tests/unit/test_opts.py index 969e1788ad..664cd1a0ce 100644 --- a/glance/tests/unit/test_opts.py +++ b/glance/tests/unit/test_opts.py @@ -144,7 +144,8 @@ class OptsTestCase(utils.BaseTestCase): 'eventlet_executor_pool_size', 'store_type_preference', 'flavor', - 'config_file' + 'config_file', + 'public_endpoint' ] self._check_opt_groups(opt_list, expected_opt_groups)