NGINX to proxy SSP


Badge +4

Hello.
I need a way to proxy SSP with NGINX. I found a configuration that works fine for all the SSP operation except the VM console. As I see the console use VNC and I don't know how to proxy this.
The NGINX config file is as follow:

server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 301 https://$host$request_uri;}
server { listen 443 ssl; server_name localhost; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log error;
ssl_certificate /etc/nginx/ssl/nginx.crt; ssl_certificate_key /etc/nginx/ssl/nginx.key;
set $prism_url 'https://20.172.59.29:9440'; set $sspuri '/ssp'; set $sspapi '/api'; set $sspstatic '/static';
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_set_header X-Forwarded-Proto $scheme;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off;
proxy_pass $prism_url$sspuri; proxy_redirect https://$host:9440/ $scheme://$host:443/;
}
location /ssp {
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_set_header X-Forwarded-Proto $scheme;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off;
proxy_pass $prism_url$request_uri; proxy_redirect https://$host:9440/ $scheme://$host:443/; }
location /static {
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_set_header X-Forwarded-Proto $scheme;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off;
proxy_pass $prism_url$request_uri; proxy_redirect https://$host:9440/ $scheme://$host:443/; }
location /api {
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_set_header X-Forwarded-Proto $scheme;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off;
proxy_pass $prism_url$request_uri; proxy_redirect https://$host:9440/ $scheme://$host:443/; }
location /vm_console {
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_set_header X-Forwarded-Proto $scheme;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; expires off;
proxy_pass $prism_url$request_uri; proxy_redirect https://$host:9440/ $scheme://$host:443/; } }


When I try to open the VM console the error is as attached picture.
Can anyone help me to correctly setup NGINX for SSP access..?
Thanks
bye

francesco


1 reply

Badge +4
Hello.
I fixed it.
To make the VM consoles able to work I added the following directives to the 'location /vm_console' block:

proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";

Thanks
Best Regards

francesco

Reply