Configure Nginx to use HUMMIX behind a reverse proxy

A reverse proxy is used to redirect requests from external users sent to the server in the company’s corporate network. A reversed proxy needs to be installed on the company’s gateway that has:

  • At least one public IP address that gets requests from the Internet.
  • Connection to the corporate network, for example, 192.168.1.0/24.

To use a reverse proxy, you need to register a domain name and add a DNS A record specifying the reverse proxy’s public IP address. You can register an unlimited number of domain names for one IP address. Then, depending on the domain name, you can distribute the incoming traffic to different servers within the corporate network using the proxy_pass directive.

In the example below, we’re using the hummixclient.domain.com domain name.

The example server with the HUMMIX application is located at the following IP address in the corporate network: 192.168.1.10.

Attention

The HUMMIX application will not work correctly with port forwarding. This article shows how to use Nginx as the reverse proxy.

Here is an example of Nginx reverse proxy configuration for the HUMMIX application:

server {
    listen 80;
    server_name hummixclient.domain.com; #external domain that HUMMIX will be available at
    return 301 https://$server_name$request_uri; 
}
 
server {
    listen 443 ssl http2;
    server_name hummixclient.domain.com; #external domain that HUMMIX will be available at
 
    ssl_certificate /etc/nginx/cert.crt;
    ssl_certificate_key /etc/nginx/cert.key;
 
    location / {
        proxy_pass http://192.168.1.10; #IP address of the server that HUMMIX is installed on 
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;
        
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme; 
}}

During installation or reconfiguration, in the Enter host field, specify hummixclient.domain.com as the external domain that HUMMIX will be available at and use the following parameter: in the values-hummix.yaml file, set the hummix.db.s3.ssl.enabled parameter to true.

Note

Note

The following parameters are required for the web sockets in the application to work correctly:

  • proxy_http_version 1.1
  • proxy_set_header Upgrade $http_upgrade
  • proxy_set_header Connection "upgrade"