How to redirect Pipeline Pilot HTTP calls to the secure HTTPS port

You can configure Pipeline Pilot to only accept calls through the secure port (default is 9943) using HTTPS by changing the "Server Port Usage" setting in the Admin Portal under Setup > Server Configuration to "SSL Only". It is recommended to configure Pipeline Pilot this way for security reasons. But the drawback is that connections will then fail if users tries to connect using HTTP as they are not automatically redirected.

If you want to keep the HTTP port active and redirect any calls to this to the HTTPS port, you need to provide some directives in a configuration file. The recommendation is to place custom configuration files in "/web/conf/" so that the configuration is not overwritten by the installer during e.g. an upgrade.

Attached is an example configuration file (redirect_http.txt) that will:

A - Add a listener to port 80 (the default HTTP port) and redirect any calls to this to the HTTPS port, 9943.

B - Redirect any calls to port 9944 (the default Pipeline Pilot HTTP port) to the HTTPS port.

If you rename this file to e.g. "redirect_http.conf " and drop it into the "/web/conf/" folder, you will have the following redirects:
http://servername.domain.com => https://servername.domain.com:9943
http://servername.domain.com:9944 => https://servername.domain.com:9943

NOTES:

  • You need to edit the file and use the servername and port numbers applicable to your specific server.
  • The listener to port 80 was added for convenience so that users don't have to enter this in the URL but this port might already be in use by some other service on your server. If that is the case, you need to remove the Listener and VirtualHost directives for this port.
  • The reason there is no Listener directive for port 9944 and 9943 in this file is that these are already defined elsewhere in the default configuration so we only need to add the redirects for these ports.
Comments 4
KJ
KJ 2023-06-13

Download and rename this example file to redirect_http.conf

comment imagecomment image
SP
SP 2023-06-20

@KJ something is wrong in your example redirect_http.conf as my PP Services do not start any longer after placing this configuration, but I did not investigate what is wrong.

KJ
KJ 2023-06-21

The reason behind the problems experienced by @SP was that he already had another application listening to port 80 which caused a conflict and prevented the Pipeline Pilot services from starting. In such a case, when there is already another application listening to port 80, the "Listen 80" line and the corresponding VirtualHost directives must be removed from the configuration file.

KJ
KJ 2023-06-21

Another thing to be aware of is that if the Pipeline Pilot server is configured with "Server Port Usage = SSL Only", there is no longer any pre-configured listener for port 9944. If you still want users to be able to use the unsecure URL and get redirected to the secure URL, you also need to add a line "Listen 9944" after the existing "Listen 80" line like:


#Add a listener to port 80 (the generic default HTTP port)
Listen 80

#Add a listener to port 9944 (the default Pipeline Pilot HTTP port)
Listen 9944

#Redirect any calls to port 80 to the HTTPS port

    Redirect permanent "/" "https://kjn1-w2019-app1.dsone.3ds.com:9943"

#Redirect any calls to port 9944 to the HTTPS port

    Redirect permanent "/" "https://kjn1-w2019-app1.dsone.3ds.com:9943"


However, in this case redirects are still problematic since Pipeline Pilot enables the HTTP Strict Transport Security (HSTS)​​​​​​​ to tell browsers that the site should only be accessed using HTTPS. This means that once the browser has recognized that a certain site uses a secure connection, any subsequent calls to that site should use https. So even if "http" is specified in the URL, the browser will change this to "https" automatically. Since the server does not accept https calls to port 80 or 9944 (the server must still accept the call before the redirect happens), you will see an error message "This site can’t provide a secure connection".


It can be noticed that the call works the first time after the browser cache has been cleared or in a newly opened incognito window. But any subsequent calls will fail due to the automatic switch from "http" to "https" in many modern browsers.


At the end, I do not recommend using the redirects discussed here if you have configured your Pipeline Pilot server to use "SSL Only" simply because they are of limited use.