Configuring NGINX

Below is a description of how to configure NGINX as a reverse proxy for Intrexx.

If you want to create your own configurations for web front ends (Nginx, IIS, Apache, HAProxy, TrafficServer, etc.), please note the following:

HTTPS

  • Access via HTTPS only

  • Redirect from HTTP to HTTPS

Blocked URLs

  • Hidden files and directories starting with .. Exception: /.well-known/

  • /WEB-INF/ (recursive)

  • /web.config

  • /bin/ (recursively)

1. Customize the configuration file

When upgrading, replace the following line in the NGINX configuration file:

location ~ (css|download|images|include|is|script|temp|thirdparty|userfiles) {

by the following line

location ~ ^(/css|/fonts|/images|/include|/script|/thirdparty|/userfiles|/download|/is) {

This typically affects Nginx configuration files created with Intrexx 20.09, 20.03 OU3, 19.09, 19.03 OU13, or earlier versions.

Intrexx Version 12.0.1

The adjustments for Intrexx 12.0.1 are related to the changes in access permissions for the "userfiles" directory ("<portal-directory> \external\htmlroot\userfiles"), where, if configured accordingly, portal users can upload image files and download them from there as well.

For more information on this topic, see the " Portal Properties - Security - Upload/Download" section.

Up through Intrexx 12.0.0, image files were made available via the Fronten web server (reverse proxy). Starting with Intrexx 12.0.1, this is done using the web server (Tomcat) integrated into Intrexx. For this reason, the "userfiles" directory must be removed from the configuration file.

For more information about the front-end web server (reverse proxy) and Embedded Tomcat, see the section " Using the Front-End Web Server (Reverse Proxy)."

When upgrading, replace the following line in the NGINX configuration file:

location ~ (css|download|images|include|is|script|temp|thirdparty|userfiles) {

by the following line

location ~ ^(/css|/fonts|/images|/include|/script|/thirdparty) {

This typically affects Nginx configuration files created with Intrexx 20.09, 20.03 OU3, 19.09, 19.03 OU13, or earlier versions.

NGINX is configured using configuration files. After you have downloaded the Intrexx setup files, you will find three template files for configuring NGINX. You can use these as a basis for configuring your NGINX.

You can find the template files at the following path: <INTREXX-ROOT>/samples/web-tls-configuration/nginx/

The names of the template files are portal-intranet.conf, portal-internet.conf, and portal-remote.conf

Note: In addition to the settings in the "portal-intranet.conf" file, the "portal-internet.conf" file also contains a section for configuring OCSP stapling.

You can use the expandable links below to view the files and get an overview.

Open the file in an editor of your choice to make the necessary changes.

TODOs

You'll find configuration instructions in the file. These are each marked with "TODO."
Key tasks are:

  • the Web Connector and port information

  • Specify the server name (fully qualified domain name) and port

  • Information About SSL

  • Path to the certificate file (*.cer or *.pem) and the private key

It is also important to specify the correct path to the portal's "external/htmlroot" directory.

  1. To do this, open "Portal > Portal Properties > Front-End Web Server (Reverse Proxy/Load Balancer) > Front-End Web Server."

    Name

    Description

    NGINX Virtual Host

    "NGINX Virtual Host" refers to the embedded Tomcat. NGINX establishes a connection to the Intrexx portal service via the virtual host. Usually, you should enter "localhost" here. (An exception may apply if NGINX is installed on a different server than Intrexx. (In that case, the Intrexx server should be specified here.)

    NGINX Configuration File

    You can generate the NGINX configuration file using Intrexx.

    Enter the path to the directory where you want to create the NGINX configuration file.
    Example: /myfolder/portal.example.com.conf
    Next, copy the NGINX configuration file to the desired location under /etc/nginx.
    Example: /etc/nginx/sites-available/portal.example.com.conf

    Embedded Tomcat Port

    This displays the port you used in the previous version of Intrexx. You can leave this port as is.

    Note: For a new installation, port 1337 is the default setting here.

    Portal Base URL

    The base URL must be specified here.
    The first part consists of the minutes. Please note that "https" is specified here. The second part consists of specifying the hostname that you have defined in the NGINX configuration file. Note that a trailing slash (/) is included. It is essential that you enter the correct information so that your portal can be accessed in the browser.

  2. Click "OK."
    Intrexx generates the configuration file. The information entered in the input fields is then written to the configuration file. The file will be saved in the specified directory.

2. Place the configuration file in the "sites-available" directory

Place the configuration file in the "sites-available" directory.

Note: Depending on your Linux distribution and the installation package you selected, the "sites-available" directory may not be available.

Typically, the "sites-available/site-enabled" directories are present when you install Nginx from the repositories of Debian-based distributions. If you install Nginx from the Nginx repository, those directories do not exist. In this case, only conf.d/ is present. The same applies to other Linux distributions, such as CentOS. Here, too, conf.d/ is present.

In this case, find out how the configuration file needs to be set up for your Linux distribution.

3. Create a symbolic link to the configuration file

Create a symbolic link from `sites-enabled` to the `sites-available` file. Be sure to use the full paths.

Note: When using symlinks, be sure to create them directly in the desired directory.

Example: "ln -s /etc/nginx/sites-available/host.example.org.conf"

4. Restart NGINX

Restart NGINX.

NGINX and Intrexx on Different Servers (NGINX on a Remote Machine)

  1. If NGINX is running on a different server than Intrexx, you must comment out the following blocks in the configuration file:

    Root Directive (The root path of the Intrexx web application.)

    • Settings for favicon and robots.txt (serve favicon and robots.txt)

    • Setting for static files (Static files that should be served by Nginx)

    You must comment out these blocks to prevent NGINX from serving the static files, since it does not have access to the portal's remote htmlroot.

  2. In the "web.xml" file (<Portal Directory>\external\htmlroot\WEB-INF\web.xml), you must set the "NonLoopback" parameter to "true".

    <init-param>
         <description>
              Allow receiving security-sensitive headers on non-loopback network interfaces.
              Values: true or false (default).
         </description>
         <param-name>
              connector.security.header.receiveOnNonLoopbackInterface
         </param-name>
         <param-value>
              true
         </param-value>
    </init-param>
    

For more information on this topic, see the sample configuration file portal-remote.conf.

Configuring WebSockets

To use WebSockets with NGINX, you must specify in the NGINX configuration file which URLs should be forwarded to the backend via the WebSocket protocol. In the default configuration, this looks like this:

...

# Delegate WebSocket requests to the Intrexx Portal Service.

#

location /ws/ {

proxy_pass https://backend;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "Upgrade";

}

# Delegate requests to the Intrexx Portal Service.

#

location / {

proxy_pass https://backend;

...

 

Note: When upgrading from an earlier version of Intrexx, the existing configuration file must be modified accordingly to enable the use of WebSockets.

For more information on WebSockets, see the WebSockets chapter.