Configure NGINX

To be able to use NGINX as the reverse proxy for Intrexx, it needs to be configured.

1. Adjust the configuration file

Change in 20.09

When upgrading to Intrexx 20.09, open the NGINX configuration file and replace the line

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

with the following line

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

Usually, this affects NGINX configuration files that were created with ntrexx 20.03 OU3, 19.09, 19.03 OU13 or older.

Two template files for the NGINX configuration are included in the downloaded setup files. You can find these in the following directory:

<INTREXX-ROOT>/samples/web-tls-configuration/NGINX/portal-intranet.conf

<INTREXX-ROOT>/samples/web-tls-configuration/NGINX/portal-internet.conf

Please note: The "portal-internet.conf" contains more entries than the "portal-intranet.conf" file as it also contains a section for configuring the OCSP stapling.

Open the file in an editor of your choice.

The file contains instructions for the configuration. Each one of these is labeled with "TODO".
The most important TODOs are: It is also important that the path to the portal's "external/htmlroot" directory is specified correctly.

Please note: If you have already installed Intrexx 20.09, you can also generate the configuration file with Intrexx.
  1. To do this select "Portal properties" from the "Portal" menu and go to "Web configuration > Front-end web server".



    NameDescription
    TypeSelect "NGINX" here.
    Server nameEnter the server name (or hostname) that should be used to access the portal in the browser.

    For example: "portal.example.org"

    The server name (or hostname) entered here needs to be defined as part of the base URL in the portal properties.

    Back-end host"Back-end host" refers to the embedded Tomcat. NGINX connects to the Intrexx portal service via the back-end host.

    Typically, "localhost" should be entered here. (One exception to this is when NGINX is installed on a different server to Intrexx.)
    Back-end portThe port that you used in Intrexx 18.03 will be shown here. You can leave this port as it is.

    Please note: The port 1337 is predefined for a new installation.
    Write configuration to fileIf you activate the checkbox here, you can generate the NGINX configuration file with Intrexx.

    In this case, Intrexx takes the information in the "Server name", "Back-end host" and "Back-end port" fields and writes them to the NGINX configuration file.

    Enter the path to the directory that the NGINX configuration file should be generated in.

    Example: "/myfolder/portal.example.org.conf"

    Afterwards, copy and link the NGINX configuration file to the desired folder within "/etc/nginx".

    Example: "/etc/nginx/sites-available/ portal.example.org.conf"

  2. Click on "OK".
    Intrexx will now generate the configuration file. The data entered in the edit fields will be written in the configuration file. The generated file is stored in the specified directory.
2. Save the configuration file in the "sites-available" directory.

Move the configuration file to the "sites-available" directory.

Please note: Depending on the Linux distribution and the selected installation package, the "sites-available" directory may not be available in some cases. If this is the case, please find out how the configuration file needs to be implemented 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. Use the full paths when doing this.

Please note: When using symbolic links, you should make sure that these are created 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
If NGINX is running on a different server to Intrexx, you need to comment out the following blocks in the configuration file: It is necessary to comment out these blocks so that static files are not delivered by NGINX as it has no access to the remote htmlroot of the portal.

Configure WebSockets
So that you can use WebSockets in conjunction with NGINX, you need to specify which URLs should be forwarded to the backend via the WebSocket protocol in the NGINX configuration file. This looks like this for the default configuration:

...

# Delegate WebSocket requests to the Intrexx Portal Service.
#
location /ws/ {
proxy_pass http://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 http://backend;

...

Please note: If you are upgrading from an earlier version of Intrexx, the existing configuration file must be adjusted accordingly so that WebSockets can be used.

More information about WebSockets is available here.