﻿# Configure Nginx to use BRIX behind a reverse proxy

> [HTML Version](nginx-elma365-.html)

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 \[OBJECT\] domain name.

The example server with the BRIX application is located at the following IP address in the corporate network: 192.168.1.10.

````
начало внимание

````
The BRIX 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 BRIX application:

````
server \{  
    listen 80;  
    server\_name brix365client.domain.com; #external domain that BRIX will be available at  
    return 301 https://\$server\_name\$request\_uri;   
\}  
  
server \{  
    listen 443 ssl http2;  
    server\_name brix365client.domain.com; #external domain that BRIX 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 BRIX 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 **brix365client.domain.com **as the external domain that BRIX will be available at and use the following parameter: in the \[OBJECT\] file, set the \[OBJECT\] parameter to \[OBJECT\].

````
начало примечание

````
**Note**

The following parameters are required for the web sockets in the application to work correctly:

- \[OBJECT\]

- \[OBJECT\]

- \[OBJECT\]

````
конец примечание
````