1
0
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:
Daniel Molina 2015-11-06 16:28:12 +01:00
parent 838f64d5ad
commit 034f6ab8ee
2 changed files with 10 additions and 4 deletions

View File

@ -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
################################################################################

View File

@ -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",