Configuring Base URLs

Base URLs are the consistent part of a web address for a site or web application. In Sisense, the default address is localhost:8081. Sisense allows you to specify a Sisense hostname as a subfolder of a domain, for example, baseurl.sisense.com/reporting.

The result is that if your users would be accessing the Pulse page for example, instead of the default baseurl.sisense.com/pulse, they would see the URL baseurl.sisense.com/reporting/pulse.

To implement base URLs in Sisense, you need to direct your users to a reverse proxy that is configured to redirect the users to the appropriate base URL that you define in Sisense.

The implementation of a reverse proxy is done on your side. An example reverse proxy configuration file for Ngnix is provided below.

Implementing a base URL on Sisense’s side requires updating the default.yaml configuration file on your Sisense server.

To configure a new base URL in Sisense:

  1. With a text editor, open the default.yaml file located at …\Program Files\Sisense\PrismWeb\vnext\config
  2. Add the property proxyurl: ‘yourbaseURL’ to the webServer object. For example:
    webServer:
    ver: '5.0'
    port: 40002
    iisPort: 8081
    virtualDir: '/api'
    apiVersion: 'Beta'
    oldApi: '/apiv1'
    secure: false
    reportPath: \sisense\reports\
    jobEnable: true
    trackEnable: true
    dashboardPath: 'http://localhost/app/main#/dashboards/'
    proxyurl: https://baseurl.sisense.com/reporting
    enableSSl: false
    jsonLimit: '25mb'
  3. Save your changes.

There are a variety of reverse proxies you can choose to implement a base URL. You can see an example Ngnix configuration below (ngnix.conf):

worker_processes  1;
events {
     worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    proxy_connect_timeout       6000;
    proxy_send_timeout          6000;
    proxy_read_timeout          6000;
    send_timeout                6000;
    server {
         #listen       80;
         server_name  site.corporate.com;
         listen              443 ssl;
         ssl_certificate     "location of pem file";
         ssl_certificate_key "location of key file";
         ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
         ssl_ciphers         HIGH:!aNULL:!MD5;
         rewrite ^/reporting$ /reporting/ last;
         location ~/reporting(/.*)$ {
           set $path $1;
           client_max_body_size 2G;
           proxy_pass   http://sisenseIP:sisensePort$path$is_args$args;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           proxy_set_header X-Real-IP  $remote_addr;
           proxy_set_header X-Forwarded-For $remote_addr;
           proxy_set_header Host $host;
           proxy_connect_timeout       6000;
           proxy_send_timeout          6000;
           proxy_read_timeout          6000;
           send_timeout                6000;
           #if ($http_origin ~* '^(http://origin1.com:8081|https://www.origin2.org)$') {
           # set $cors_origin '${http_origin}';
           # set $cors_cred 'true';
           # set $cors_methods 'GET, POST, DELETE, PUT, OPTIONS, PATCH, HEAD';
           # set $cors_headers 'Content-Type, X-Device-Id, X-API-KEY, Origin, Authorization, X-Requested-With, Accept, Key, Cache-Control
           #}
           add_header Access-Control-Allow-Origin $cors_origin always;
           add_header Access-Control-Allow-Credentials $cors_cred always;
           add_header Access-Control-Allow-Methods $cors_methods always;
           add_header Access-Control-Allow-Headers $cors_headers always;
           if ($request_method = OPTIONS) {
           return 200;
           }
         } 
      }
   }