# Apache as reverse proxy for Sunstone.....but no\_vnc?

**URL:** <https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998>\
**Category:** Product Support\
**Created:** [May 18, 2018, 4:43pm UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998 "2018-05-18T16:43:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@Igor](https://forum.opennebula.io/u/Igor)\
**Post date:** [May 18, 2018, 4:43pm UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998/1 "2018-05-18T16:43:16Z")

</div>

I have a separate apache server that i’m using to reverse in https the opennebula FE;  
all work well, but when i try to open vm consoles under novnc or spice, nothing appear.

ATM the apache server configuration reverse proxying OpennebulaFE is:

\<VirtualHost 192.168.1.40:443\>  
ServerName myserver

ProxyPreserveHost Off

RewriteEngine on  
RewriteRule ^(.\*)+(nebula)$ %{REQUEST\_URI}/ [R=301,L]

SSLEngine on  
SSLCertificateFile /etc/pki/certs/xxxx.crt  
SSLCertificateKeyFile /etc/pki/private/xxxxx.key  
SSLCertificateChainFile /etc/pki/certs/xxxxxxxx.pem

\<Location /nebula\>  
ProxyPass [http://192.168.1.202:9869](http://192.168.1.202:9869)  
ProxyPassReverse [http://192.168.1.202:9869](http://192.168.1.202:9869)

I read about ws://xxxxx/:29876 websockify settings… but nothing worked for me.

servers:  
(192.168.1.40 - apache reverseproxy)—  
(192.168.1.202 - opennebulaFE -sunstone)—  
(192.168.1.201 - opennebula node kvm-hypervisor)

Any ideas ??

Thanks

Igor

---

<div class="post-metadata">

**Author:** ![lorenzo\_faleschini](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/lorenzo_faleschini/32/4242_2.png) [@lorenzo\_faleschini](https://forum.opennebula.io/u/lorenzo_faleschini)\
**Post date:** [May 18, 2018, 5:40pm UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998/2 "2018-05-18T17:40:10Z")

</div>

Dirty trick.

Set a persistent ssh tunneled port from your Apache proxy to your sunstone

Set this in autostart eventually in a screen session at startup

```auto
autossh -f -M 0 -N -i /path/to/youruser/id_rsa -o ExitOnForwardFailure=yes -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -L 29876:localhost:29876 user@yoursunstoneserver

```

And your vnc will work.

autossh will keep the tunnel up even in network loss

Cheers

---

<div class="post-metadata">

**Author:** ![lorenzo\_faleschini](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/lorenzo_faleschini/32/4242_2.png) [@lorenzo\_faleschini](https://forum.opennebula.io/u/lorenzo_faleschini)\
**Post date:** [May 18, 2018, 5:46pm UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998/3 "2018-05-18T17:46:23Z")

</div>

If someone has better suggestions those are welcome, tried (not hard, but lazily) to proxy the websocket of the vncproxy with nginx but did not managed to get it working (yet).  
So I’m still using autossh tunnel since is working fine for my needs, not elegant but working.

---

<div class="post-metadata">

**Author:** ![Igor](https://avatars.discourse-cdn.com/v4/letter/i/dec6dc/32.png) [@Igor](https://forum.opennebula.io/u/Igor)\
**Post date:** [May 18, 2018, 6:07pm UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998/4 "2018-05-18T18:07:45Z")

</div>

Grazie !! Thank you Lorenzo…i will try this workaround waiting a solution for ProxyPass.

Bye

---

<div class="post-metadata">

**Author:** ![feldsam](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/feldsam/32/4441_2.png) [@feldsam](https://forum.opennebula.io/u/feldsam)\
**Post date:** [May 19, 2018, 8:05am UTC](https://forum.opennebula.io/t/apache-as-reverse-proxy-for-sunstone-but-no-vnc/5998/5 "2018-05-19T08:05:40Z")

</div>

What about this?

[http://nginx.org/en/docs/http/websocket.html](http://nginx.org/en/docs/http/websocket.html)
