5 Replies Latest reply: Feb 6, 2018 6:01 AM by Jordi Gonzalez RSS

    Qlik Sense redirect HTTP to HTTPS

    Jordi Gonzalez

      Hi all,

       

      We have a Qlik Sense server installed and running on a OVH Private Cloud instance. In order to make the access easier to the users we need to redirect all the traffic of http://qlik.company.com to https://qlik.company.com.

       

      I read about it and I saw a lot of posts that suggest to use a IIS o Nginx Proxy service to set up the reverse proxy but in all posts this scenario the tools are installed on a second server.


      Anyone have any experience to do on the same server? Meaning, Qlik Sense + IIS or Qlik Sense + Nginx in the same server.


      Any other options? There is a way to do it using the "Proxy Service" or an external tool of Qlik Sense?


      Thank's in advance!

        • Re: Qlik Sense redirect HTTP to HTTPS
          Levi Turner

          This worked historically doing some quick validation tests.


          Method (assumption is that Qlik Sense is *not* running on port 80)

          • Download Nginx (http://nginx.org/download/nginx-1.13.8.zip)
          • Unpack so that the file structure is C:\Nginx\nginx.exe
          • Backup C:\nginx\conf\nginx.conf
          • Open C:\nginx\conf\nginx.conf
          • Swap out with this conf file ; an example)
          • Cmd.exe
            • cd C:\nginx
            • nginx.exe
          • Validate
          • Kill the EXEs in Task Manager before trying to install as a service

           

          To install as a service:

          • Download Nuget (https://dist.nuget.org/win-x86-commandline/latest/nuget.exe)
          • Place in C:\nuget
          • Rename C:\nuget\WinSW.2.1.2\lib\net40-full\WinSW.NET4.exe to C:\nuget\WinSW.2.1.2\lib\net40-full\nginxservice.exe
          • Backup C:\nuget\WinSW.2.1.2\lib\net40-full\WinSW.NET4.xml
          • Place attached XML in C:\nuget\WinSW.2.1.2\lib\net40-full\
          • Cmd.exe
            • cd nuget
            • nuget.exe install WinSW
            • cd C:\nuget\WinSW.2.1.2\lib\net40-full
            • nginxservice.exe install
          • Validate

           

          Uninstall steps:

          • nginxservice.exe stop
          • nginxservice.exe uninstall

           

          nginx.conf:


          #user  nobody;
          worker_processes  1;
          
          
          #error_log  logs/error.log;
          #error_log  logs/error.log  notice;
          #error_log  logs/error.log  info;
          
          
          #pid        logs/nginx.pid;
          
          
          
          
          events {
              worker_connections  1024;
          }
          
          
          
          
          http {
              include       mime.types;
              default_type  application/octet-stream;
          
          
              #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
              #                  '$status $body_bytes_sent "$http_referer" '
              #                  '"$http_user_agent" "$http_x_forwarded_for"';
          
          
              #access_log  logs/access.log  main;
          
          
              sendfile        on;
              #tcp_nopush     on;
          
          
              #keepalive_timeout  0;
              keepalive_timeout  65;
          
          
              #gzip  on;
          
          
              server {
                  listen       80;
                  server_name  localhost;
          
          
                  #charset koi8-r;
          
          
                  #access_log  logs/host.access.log  main;
          
          
                  # location / {
                  #     root   html;
                  #     index  index.html index.htm;
                  # }
           location / {
           root   html;
           proxy_set_header   X-Real-IP $remote_addr;
           proxy_set_header   Host      $http_host;
           proxy_pass         https://localhost:443;
           }
          
          
                  #error_page  404              /404.html;
          
          
                  # redirect server error pages to the static page /50x.html
                  #
                  error_page   500 502 503 504  /50x.html;
                  location = /50x.html {
                      root   html;
                  }
          
          
                  # proxy the PHP scripts to Apache listening on 127.0.0.1:80
                  #
                  #location ~ \.php$ {
                  #    proxy_pass   http://127.0.0.1;
                  #}
          
          
                  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
                  #
                  #location ~ \.php$ {
                  #    root           html;
                  #    fastcgi_pass   127.0.0.1:9000;
                  #    fastcgi_index  index.php;
                  #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                  #    include        fastcgi_params;
                  #}
          
          
                  # deny access to .htaccess files, if Apache's document root
                  # concurs with nginx's one
                  #
                  #location ~ /\.ht {
                  #    deny  all;
                  #}
              }
          
          
          
          
              # another virtual host using mix of IP-, name-, and port-based configuration
              #
              #server {
              #    listen       8000;
              #    listen       somename:8080;
              #    server_name  somename  alias  another.alias;
          
          
              #    location / {
              #        root   html;
              #        index  index.html index.htm;
              #    }
              #}
          
          
          
          
              # HTTPS server
              #
              #server {
              #    listen       443 ssl;
              #    server_name  localhost;
          
          
              #    ssl_certificate      cert.pem;
              #    ssl_certificate_key  cert.key;
          
          
              #    ssl_session_cache    shared:SSL:1m;
              #    ssl_session_timeout  5m;
          
          
              #    ssl_ciphers  HIGH:!aNULL:!MD5;
              #    ssl_prefer_server_ciphers  on;
          
          
              #    location / {
              #        root   html;
              #        index  index.html index.htm;
              #    }
              #}
          
          
          }
          

           

          nginxservice.xml

          <service>
            <id>nginx</id>
            <name>nginx</name>
            <description>nginx</description>
            <executable>c:\nginx\nginx.exe</executable>
            <logpath>c:\nginx\logs\</logpath>
            <logmode>roll</logmode>
            <depend></depend>
            <startargument>-p</startargument>
            <startargument>c:\nginx</startargument>
            <stopexecutable>c:\nginx\nginx.exe</stopexecutable>
            <stopargument>-p</stopargument>
            <stopargument>c:\nginx</stopargument>
            <stopargument>-s</stopargument>
            <stopargument>stop</stopargument>
          </service>