mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
feature #3819: Add ssl proxy url to the onegate con
(cherry picked from commit 88d4825be2d48feebb210a4323e523490f0cee67)
This commit is contained in:
parent
838f64d5ad
commit
034f6ab8ee
@ -27,6 +27,9 @@
|
||||
:host: 127.0.0.1
|
||||
:port: 5030
|
||||
|
||||
# SSL proxy URL that serves the API (set if is being used)
|
||||
#:ssl_server: https://service.endpoint.fqdn:port/
|
||||
|
||||
################################################################################
|
||||
# Log
|
||||
################################################################################
|
||||
|
@ -242,10 +242,13 @@ get '/' do
|
||||
client = authenticate(request.env, params)
|
||||
halt 401, "Not authorized" if client.nil?
|
||||
|
||||
protocol = request.env["rack.url_scheme"]
|
||||
host = request.env["HTTP_HOST"]
|
||||
|
||||
base_uri = "#{protocol}://#{host}"
|
||||
if $conf[:ssl_server]
|
||||
base_uri = $conf[:ssl_server]
|
||||
else
|
||||
protocol = request.env["rack.url_scheme"]
|
||||
host = request.env["HTTP_HOST"]
|
||||
base_uri = "#{protocol}://#{host}"
|
||||
end
|
||||
|
||||
response = {
|
||||
"vm_info" => "#{base_uri}/vm",
|
||||
|
Loading…
x
Reference in New Issue
Block a user