# Setting up a Proxy for Mobile App Access to HES

{% hint style="info" %}
**A proxy server is required to redirect the mobile application from the external network to the local network where the Hideez Enterprise Server (HES) is running.**
{% endhint %}

### **Setting up a Proxy for Mobile App Access to HES**

**Step 1: Set Up the Reverse Proxy Server**

1. **Choose a Platform**:
   * Use **Nginx** or **Apache** for the reverse proxy, either on **Linux** or **Windows**.
2. **Ensure Internet Access to the Proxy**:
   * The proxy server must be accessible from the internet. Open the necessary ports (e.g., 80 for HTTP or 443 for HTTPS) on your firewall or router.
   * Register a domain name (e.g., **<https://hesproxy.hideez.com>**) and link it to the public IP address of your proxy server.

**Step 2: Configure Communication Between Proxy and HES**

1. **Allow Access Between Proxy and HES**:
   * Ensure that the proxy can reach the HES server in the local network and that the firewall rules allow traffic between the proxy and HES.
   * Confirm that HES can respond to requests routed through the proxy.

**Step 3: Modify appsettings.json on the Proxy Server**

1. **Open appsettings.json** on the proxy server.
2. **Update the HES Address**:
   * Locate the configuration block related to the reverse proxy:

     ```json
     jsonCopy code"ReverseProxy": {
       "Clusters": {
         "cluster1": {
           "Destinations": {
             "destination1": {
               "Address": "https://localhost/"
             }
           }
         }
       }
     }
     ```
   * Replace `"https://localhost/"` with the HES server’s local hostname or IP address, such as:

     ```json
     "Address": "https://hes.mycompany.local"
     ```

**Step 4: Expose the Proxy to the Internet**

1. **Set Up Public Proxy Address**:
   * Configure your proxy to expose the HES server to the internet via the registered public URL (e.g., **<https://hesproxy.hideez.com>**).
2. **Configure HTTPS (Optional but Recommended)**:
   * Set up SSL/TLS certificates for secure HTTPS access using a certificate authority like Let’s Encrypt.

**Step 5: Configure Reverse Proxy URL in HES**

1. **Log into the HES Admin Dashboard**.
2. **Set the Reverse Proxy URL**:
   * Go to **Settings > Parameters > Reverse Proxy**.
   * Enter the public proxy URL (e.g., **<https://hesproxy.hideez.com>**) as the reverse proxy address.
