Redirect access port 80 to 9869 automatically on frontend

Hello.

I put my frontend in a public ip.

Please need a help to redirect the port 80 traffic to 9869 in the frontend. Ubuntu is a 14 machine.

I followed this tutorial to ride my scenario:

http://docs.opennebula.org/4.12/design_and_installation/quick_starts/qs_ubuntu_kvm.html

Just installed on this machine packages the tutorial suggests.

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 9869

Using nginx:

[code]server {
listen 80;
server_name YOURFQDNHERE;
server_tokens off;
error_log /var/log/nginx/error-YOURFQDNHERE.log;
access_log /var/log/nginx/access-YOURFQDNHERE.log main;

assuming your vncproxy uses SSL, you could do:

rewrite ^/(.*) https://YOURFQDNHERE/$1;

otherwise:

add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
root /usr/lib/one/sunstone/public;
try_files $uri/index.html $uri.html $uri @sunstone;
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires 1y;
try_files $uri @sunstone;
}
location @sunstone {
proxy_redirect off;
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://127.0.0.1:9869;
}
include /etc/nginx/errors.conf;

}[/code]

Hello, best and secure solution is use nginx as reverse proxy with ssl.

Thank you.

You can also look into using stunnel. It will wrap the traffic in SSL and do the redirection