Menu

qTest Scenario and Nginx Configuration Guide

Overview

As of qTest Scenario 3.3.0 OD, Scenario can now be configured to work with Nginx. This article outlines how to set up this configuration.

Prerequisites

  • You need to have generated a Client and Server key pair.
    • You can find the instructions to find key here.
  • Nginx is properly configured and working as expected. 
  • The account that setup Scenario must have the Global Administration permission

Requirements

Allowing access to all.js and all_debug.js

qTest Scenarios plugin for Jira requires all.js and all_debug.js for conducting a secure channel so that Scenario Server can communicate with the plugin (for more information about all.js and all-debug.js, refer to this link https://developer.atlassian.com/cloud/jira/platform/about-the-javascript-api/).

When the Jira Server is not behind the Nginx Server, the iframe of Scenario Plugin will use the Jira Server BaseURL to construct a full URL to all.js and all-debug.js.

For example: if the Jira Server BaseURL is https://example.com then the full URL to all.js will be https://example.com/atlassian-connect/all.js.

However, when the server is behind Nginx, the path will be changed to https://<Nginx Server base URL>/atlassian-connect/all.js which prevents the plugin to work properly since Nginx will ask for authentication.

Therefore, in the Nginx configuration for Jira Server, use these lines to allow access to all.js and all-debug.js without authentication:

location = /atlassian-connect/all-debug.js {
proxy_pass <jira server base URL>/atlassian-connect/all-debug.js;
}

location = /atlassian-connect/all.js {
proxy_pass <jira server base URL>/atlassian-connect/all.js;
}

Nginx self-signed certificate issue

To serve the resources over HTTPS, Nginx requires a private key and a public certificate. These can be generated internally.

However, the browser will not trust the certificates by default. This will prevent the Scenario Plugin from loading all.js and all-debug.js through Nginx.

The symptoms are:
• Iframe stuck loading
scenario_iframe_stuck_loading.png
• Console log of developer tools in the browser will throw errors related to all.js and all-debug.js
scenario_console_log_error.png

There are two ways to solve this issue:

  1. Using commercial certificates.
  2. Add the certificate to the trusted list of all the machines using Jira and Scenario through a browser. Read Install Self-signed Certificate To The Browser Guide for additional information. 

Configure Scenario to work with JIRA Server and Nginx

  1. From your JIRA instance, select Jira System in the Gear button (jira_gear.png ) beside the account image.
  2. The Administrator page updates, select the Add-ons tab.
  3. Choose Manage add-ons at the left navigation panel.
  4. Select qTest Scenario - BDD for Jira add-on then choose Configure.
  5. Follow the instructions below that align with your configuration:

    • Configuration 1: Nginx without Client Certificate and OAuth 2.0
      1. Change the Jira Server Base URL to Nginx URL
      2. Click Save configuration.
    • Configuration 2: Nginx with Client Certificate
      1. Change the Jira Server Base URL to Nginx URL
      2. Configure certificate: copy the content of the Client certificate file and key then paste to the corresponding text box. If the private key has a passphrase, then type it to the Passphrase text box.
        Note: we only support key decryption for pkcs8 format.
      3. Click Save configuration.

    • Configuration 3: Nginx with OAuth 2.0
      1. Change the Jira Server Base URL to Nginx URL
      2. Configure OAuth 2.0: enter your Client ID and Client Secret to the corresponding ClientId and Client secret text box.
        Note: we only support auth server Okta.
      3. Click Save configuration.

    • Configuration 4: Nginx with Client Certificate and OAuth 2.0
      1. Change the Jira Server Base URL to Nginx URL.
      2. Scroll down to the end.
        scenario_nginxcert_oauth2.0.png
        • Configure key pair: copy the content of the Client certificate file and key then paste to the corresponding text box. If the private key has a passphrase, then type it to the Passphrase text box.
          Note: we only support key decryption for pkcs8 format.
        • Configure OAuth 2.0: enter your Client ID and Client Secret to the corresponding ClientId and Client secret text box.
          Note: we only support server Okta.
      3. Select Save configuration.
Powered by Zendesk