# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enterprise.hideez.com/hideez-enterprise-server/administration/setting-up-a-proxy-for-mobile-app-access-to-hes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
