> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hivenet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to serve a simple HTTPS site on Compute with SSH port forwarding

> Use python -m http.server or your own web app with secure access

## What this solves

If your app prints something like:

```text theme={null}
Serving HTTP on 127.0.0.1 port 8888
```

and your public URL (e.g. `https://<instance-id>-8888.tenants.hivecompute.ai`) shows **Bad Gateway**, it likely means:

* The app is only available locally (localhost)
* HTTPS reverse proxy can’t reach it

### Step 1 – Start your server (pick **one**)

| If you already have an app                                                                                                                  | If you just want to browse files                                                   |
| :------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- |
| SSH into the instance and launch your app on **port 8888** with **host 0.0.0.0**.     Example (Flask): `app.run(host="0.0.0.0", port=8888)` | SSH in and run a one-off file server: `python3 -m http.server 8888 --bind 0.0.0.0` |

<Warning>
  Only one process can occupy port 8888. Stop the file server before starting your real app—or give one of them a different port.
</Warning>

### Step 2 – Bind to 0.0.0.0, not 127.0.0.1

Visit `https://<instance-id>-8888.tenants.hivecompute.ai`.\
If you switched ports, replace `8888` in both the URL and your app command.

### Step 3 – Open the HTTPS URL

Once your app is running and listening on the correct interface and port, go to:

```text theme={null}
https://<instance-id>-8888.<location>.tenants.hivecompute.ai
```

<Tip>
  Make sure your firewall or instance settings don’t block port 8888.
</Tip>

If you still see "Bad Gateway":

* Double-check your app is running
* Use `curl http://localhost:8888` from inside the instance to test
* Restart your app if needed

## Alternative: Use SSH port forwarding

If HTTPS still doesn’t work or you prefer to access it directly:

```text theme={null}
ssh -L 8888:localhost:8888 ubuntu@<instance-id>.ssh.hivecompute.ai
```

Then open [http://localhost:8888](http://localhost:8888) on your Windows or Mac browser
