Unable to connect to OneClick WebApp via nginx reverse proxy
search cancel

Unable to connect to OneClick WebApp via nginx reverse proxy

book

Article ID: 249135

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

When accessing the oneclick web app via reverse proxy, we get just a blank screen

Environment

Release : 21.2

Component : Spectrum Applications

Cause

When using a reverse proxy two ports are required. The Spectrum OneClick port, and also the Spectrum OneClick WebApp port.

A Web Socket connection is required for the latter

Resolution

Known configuration to work with Spectrum WebApp - replace <oneclick> with OneClick IP, hostname or FQDN:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;

        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
          proxy_pass http://<oneclick>:80;
          proxy_set_header Host $host;
          proxy_read_timeout 1d;
          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;
}

}


server {
       listen 9443;
       listen [::]:9443;


       root /var/www/htm;
       index index.html;

       location / {
          proxy_pass http://<oneclick>:9443;
          proxy_set_header Host $host;
          proxy_read_timeout 1d;
          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;
# WebSocket support (nginx 1.4)
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
}

}

The above example uses the default ports for OneClick, i.e. 80 for OneClick Tomcat, and 9443 for OneClick WebTomcat.

The important here are the directives to support WebSocket for port 9443 (OneClick WebApp):

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

It is important the web socket server port be 9443. It must match the same port used by OneClick webapp in OneClick ($SPECROOT/WebTomcat/conf/server.xml, connector port)

Additional Information

Unable to connect to OneClick WebApp via Apache HTTPD reverse proxy
https://knowledge.broadcom.com/external/article?articleId=224438