Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

TestRail behind a Apache proxy server


#1

Are there any special setting needed in the virtual host setup or anywhere else if you configure TestRail behind a an Apache web proxy server? Here is my virtual host configuration…

<VirtualHost *:443>
ServerName testrail.domain.com
ServerAdmin admin@domain.com

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyRequests           Off
    ProxyPreserveHost       On
    SSLProxyEngine          On
    ProxyPass / [url]http://000.00.00.235[/url]
    ProxyPassReverse / [url]http://000.00.00.235[/url]

    SSLEngine                               On
    SSLCertificateFile    /etc/pki/tls/certs/testrail.domain.com.crt
    SSLCertificateKeyFile /etc/pki/tls/private/testrail.domain.com.key

    ErrorLog logs/testrail/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog logs/testrail/access.log combined

#2

Hello Amorin,

Thanks for your posting. While there’s no specific technical reason against using a reverse proxy, it’s not something we currently really support for TestRail officially as it can lead to subtle issues or possible problems in the future. If you are trying to implement this just to add HTTPS support for your TestRail instance, we would highly recommend simply activating HTTPS directly on your TestRail server instead and this would be simple to activate for both Apache or IIS servers.

Or what is the main use case for using a reverse proxy in your environment? There’s usually a better way to implement this with TestRail.

Thanks!


#3

Why does testrail redirect to http even if I have set the address to https in site settings?

We are using an AWS load balancer for SSL termination, as this means we don’t have to touch the SSL cert and keys (and the cert is free).

Its a perfectly legitimate configuration to not terminate SSL on the web server, and it mostly works on testrail current version, except for the login screen, which is redirecting to http for some reason.

How can I get testrail to stop redirecting to http?


#4

Hi Brian,

Thanks for your posting. TestRail doesn’t really know that it’s being accessed via HTTPS in this case because SSL is terminated/handled by the ELB and not by the web server TestRail is running on. TestRail usually detects its base URL automatically (which is used for redirects etc.) but it is possible to override this via TestRail’s config.php:

define(‘DEPLOY_REQUEST_SERVER’, ‘https://’);
define(‘DEPLOY_REQUEST_PATH’, ‘testrail’);

You would also need to change the installation URL on Administration > Site Settings.

Cheers,
Tobias


TestRail Login Redirects to HTTP