Re: [one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-25 Thread Daniel Molina
Hi,

Sunstone server uses the ZONE_NAME http header to define the opennebula
endpoint, you have to forward it.

Cheers


On 21 August 2014 20:54, Liu, Gene gene@alcatel-lucent.com wrote:

  After I setup a proxy server (ngnix) before sunstone server on master.
 From Sunstone UI (192.168.100.10), I can not change zone to zone1. Other
 functions work well from sunstone UI, but changing zone.

-

If I remove the proxy server, and access directly to sunstone server:
192.168.100.10:9869, changing zone from sunstone portal works.

my nginx reverse proxy server setting is as below:
--
[root@vone_gene ~]# cat /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 192.168.100.10:80;
server_name mycloud.alcatel-lucent.com;

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://localhost:9869;
}

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

sunstone server settings:
-

 

# Server Configuration


 

# Directory to store temp files when uploading images
#
:tmpdir: /var/tmp

# OpenNebula sever contact information
#
:one_xmlrpc: http://localhost:2633/RPC2

# Server Configuration
#
:host: 127.0.0.1
:port: 9869


 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org




-- 
--
Daniel Molina
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | dmol...@opennebula.org | @OpenNebula
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-25 Thread Liu, Gene
Thanks Daniel!
Could you please specify how?

Gene

On 14-08-25 06:16 AM, Daniel Molina wrote:
 ZONE_NAME http header

___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-25 Thread Carlo Daffara
You should add the two parameters

underscores_in_headers on;
proxy_pass_request_headers on;

to your nginx configuration file; so that header requests are passed as-is (the 
first one is used to force passing headers that contain an underscore,
as required by Sunstone)
cheers
carlo daffara

- Messaggio originale -
Da: Gene Liu gene@alcatel-lucent.com
A: Daniel Molina dmol...@opennebula.org
Cc: users@lists.opennebula.org
Inviato: Lunedì, 25 agosto 2014 15:00:33
Oggetto: Re: [one-users] web UI does not work for zone/vDC if sunstone server 
is behind a reverse proxy server

Thanks Daniel!
Could you please specify how?

Gene

On 14-08-25 06:16 AM, Daniel Molina wrote:
 ZONE_NAME http header

___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-25 Thread Daniel Dehennin
Liu, Gene gene@alcatel-lucent.com writes:

 Thanks Daniel!
 Could you please specify how?

Using nginx, I have this in /etc/nginx/site-available/opennebula-sunstone:

#+begin_src
upstream sunstone {
server 127.0.0.1:9869;
}

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.html index.htm;

server_name nebula.example.net;

access_log  /var/log/nginx/opennebula-sunstone-access.log;
error_log  /var/log/nginx/opennebula-sunstone-error.log;

# Pass headers with underscore
underscores_in_headers on;

# To upload ISO files, increase for VMs images
client_max_body_size 1G;
location / {
include proxy_params;
# Forward ZONE_NAME to ONE process
proxy_set_header ZONE_NAME $http_zone_name;
proxy_pass http://sunstone;
}
}
#+end_src

Regards.

 Gene

 On 14-08-25 06:16 AM, Daniel Molina wrote:
 ZONE_NAME http header

 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

-- 
Daniel Dehennin
Récupérer ma clef GPG: gpg --recv-keys 0xCC1E9E5B7A6FE2DF
Fingerprint: 3E69 014E 5C23 50E8 9ED6  2AAD CC1E 9E5B 7A6F E2DF


signature.asc
Description: PGP signature
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-25 Thread Liu, Gene
Thank you Carlo!

It works after those two parameters setting.

Gene
---
server {
listen   12.34.56.78:80;
server_name  xx.yy.alcatel-lucent.com;
underscores_in_headers on;

location / {
proxy_set_headerHost $host;
proxy_pass_request_headers on;
proxy_set_header Accept-Encoding ;
proxy_set_headerX-Real-IP   $remote_addr;
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect  off;
proxy_pass  http://localhost:9869;
}

error_page  404  /404.html;
location = /404.html {
root   /usr/share/nginx/html;
}

On 14-08-25 09:02 AM, Carlo Daffara wrote:
 You should add the two parameters

 underscores_in_headers on;
 proxy_pass_request_headers on;

 to your nginx configuration file; so that header requests are passed as-is 
 (the first one is used to force passing headers that contain an underscore,
 as required by Sunstone)
 cheers
 carlo daffara

 - Messaggio originale -
 Da: Gene Liu gene@alcatel-lucent.com
 A: Daniel Molina dmol...@opennebula.org
 Cc: users@lists.opennebula.org
 Inviato: Lunedì, 25 agosto 2014 15:00:33
 Oggetto: Re: [one-users] web UI does not work for zone/vDC if sunstone server 
 is behind a reverse proxy server

 Thanks Daniel!
 Could you please specify how?

 Gene

 On 14-08-25 06:16 AM, Daniel Molina wrote:
 ZONE_NAME http header
 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


[one-users] web UI does not work for zone/vDC if sunstone server is behind a reverse proxy server

2014-08-21 Thread Liu, Gene
After I setup a proxy server (ngnix) before sunstone server on master.
From Sunstone UI (192.168.100.10), I can not change zone to zone1.
Other functions work well from sunstone UI, but changing zone.

  *

If I remove the proxy server, and access directly to sunstone
server: 192.168.100.10:9869, changing zone from sunstone portal works.

my nginx reverse proxy server setting is as below:
--
[root@vone_gene ~]# cat /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 192.168.100.10:80;
server_name mycloud.alcatel-lucent.com;

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://localhost:9869;
}

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

sunstone server settings:
-



# Server Configuration



# Directory to store temp files when uploading images
#
:tmpdir: /var/tmp

# OpenNebula sever contact information
#
:one_xmlrpc: http://localhost:2633/RPC2

# Server Configuration
#
:host: 127.0.0.1
:port: 9869

___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org