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 elma365client.domain.com
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 elma365client.domain.com; #external domain that BRIX will be available at
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name elma365client.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 elma365client.domain.com as the external domain that BRIX will be available at and enable SSL termination.
начало внимание
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"
конец внимание