Setting Up Web Forms via HTTPS

If the web application works via the HTTPS protocol, an additional setting will be required for correct work of web forms using the WebSocket protocol to ensure that encrypted WSS connection is used.

To set up web forms in the web application that works via the HTTPS protocol:

  1. Add the <VirtualHost *:9091> section after the existing <VirtualHost> section in the web server configuration file:

<VirtualHost *:9091>
  ProxyPass /service ws://localhost:${WEBFORMS_PORT}/service
  ProxyPassReverse /service ws://localhost:${WEBFORMS_PORT}/service
  SSLEngine on
  SSLCertificateFile <path to folder>/server.cer
  SSLCertificateKeyFile <path to folder>/server.key
  SSLProxyEngine On
  RewriteEngine On
  RewriteCond %{HTTP:Connection} upgrade [NC]
  RewriteCond %{HTTP:Upgrade} websocket [NC]
  RewriteRule ^(.*) ws://localhost:${WEBFORMS_PORT}/$1 [P,L]
</VirtualHost>

In the <path to folder> substitution specify the folder with the server certificate and its private key. The certificate can be prepared using special cryptographic tools, for example, OpenSSL.

NOTE. Web forms work via the 9091 port by default. If required, use the 9093 port and change the <VirtualHost *:9091> section to <VirtualHost *:9093>.

  1. Add the WEBFORMS_PORT environment variable to the end of the /etc/opt/foresight/fp10.x-webserver/envvars file:

WEBFORMS_PORT=<port number>

In the <port number> substitution specify the port, to which requests will be directed from web server to BI server, depending on the port in use at the Step 1:

  1. Add the string for listening of the port, to which requests from the client will be directed, in the web server configuration file:

Listen <port number>

In the <port number> substitution specify the port depending on the port in use at the Step 1:

  1. Enable the proxy_http, proxy_wstunnel modules if Debian-based distributions and ALT Linux are used:

sudo a2enmod-fp10.x-web proxy_http
sudo a2enmod-fp10.x-web proxy_wstunnel

  1. Execute one of the operations:

<Configuration>
  <Root>
    <Key Name="PP">
      <BIS>
        <Key Name="System">
          <WebForms Port="9093"/>
        </Key>
      </BIS>
    </Key>
  </Root>
</Configuration>

"webSocketPort": "9093"

  1. Restart the web server:

sudo systemctl restart apache2-fp10.x-web

sudo systemctl restart httpd-fp10.x-web

sudo systemctl restart httpd2-fp10.x-web

After executing the operation, web forms are set up to work via the WebSocket protocol with WSS connection encryption.

See also:

Web Application Back End