> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/deploy/enterprise-deployment/secure-gateway.md).

# Secure Gateway

Secure Gateway, Roboflow Inference Server को इंटरनेट से firewall करने पर Roboflow API और आपके models' weights के लिए एक proxy है। यह का successor है [License Server](/roboflow/roboflow-hi/deploy/enterprise-deployment/license-server.md) और model weights तथा container images की local caching जोड़ता है, ताकि inference servers का एक fleet egress के एक नियंत्रित point को साझा करे।

{% hint style="info" %}
यह पेज मूल बातें कवर करता है। पूरी configuration और operations reference के लिए, देखें [Secure Gateway मैनुअल](https://secure-gateway.roboflow.com/manual/).
{% endhint %}

## आवश्यकताएँ

* Docker Engine 20.10+, या Kubernetes v1.24+
* api.roboflow\.com और repo.roboflow\.com तक पहुँच वाला एक host
* Port 80 उपलब्ध हो, और TLS gateway के सामने load balancer पर या container के अंदर terminate हो
* 4GB+ memory
* cache के लिए एक S3 bucket, या 50GB+ local disk

## Secure Gateway का उपयोग करना

ऐसी machine पर जिसकी पहुँच हो `https://api.roboflow.com` और `https://repo.roboflow.com` (और port `80` (जो आपके private network में चल रहे Inference Server के लिए खुला हो), Secure Gateway container pull करें:

```
docker pull repo.roboflow.com/roboflow-edge/secure-gateway:latest
```

यह `latest` tag सबसे हालिया release को track करता है। Production के लिए, और खासकर air-gapped deployments के लिए, इसके बजाय एक specific version pin करें ताकि upgrades deliberate और reproducible रहें, उदाहरण के लिए `repo.roboflow.com/roboflow-edge/secure-gateway:0.2.0`.

इसे local disk cache के साथ चलाएँ:

```
docker run -d --name secure-gateway -p 80:80 --restart unless-stopped \
    -v gateway-cache:/var/cache/secure-gateway \
    repo.roboflow.com/roboflow-edge/secure-gateway:latest
```

पुष्टि करें कि यह चल रहा है:

```
curl http://localhost/health
```

local disk के बजाय S3 पर cache करने के लिए, सेट करें `CACHE_S3_BUCKET` और `CACHE_S3_REGION` environment variables। credentials unset छोड़ दें ताकि instance या IAM role का उपयोग हो सके।

## TLS certificates

डिफ़ॉल्ट रूप से gateway plain HTTP पर सुनता है, और आप उसके सामने load balancer पर TLS terminate करते हैं। Gateway से ही HTTPS serve करने के लिए, अपने certificate और private key को container में mount करें और दोनों सेट करें `TLS_CERT_FILE` और `TLS_KEY_FILE`. तब gateway अपनी configured port पर HTTPS serve करता है:

```
docker run -d --name secure-gateway -p 443:443 --restart unless-stopped \
    -e PORT=443 \
    -e TLS_CERT_FILE=/etc/ssl/certs/gateway.crt \
    -e TLS_KEY_FILE=/etc/ssl/private/gateway.key \
    -v /path/to/certs:/etc/ssl:ro \
    -v gateway-cache:/var/cache/secure-gateway \
    repo.roboflow.com/roboflow-edge/secure-gateway:latest
```

दोनों `TLS_CERT_FILE` और `TLS_KEY_FILE` inbound HTTPS सक्षम करने के लिए आवश्यक हैं, और प्रत्येक एक PEM-encoded file की ओर इशारा करता है।

जब gateway का outbound traffic किसी corporate TLS inspection proxy, जैसे Zscaler, से होकर गुजरता है, तो सेट करें `TLS_CA_BUNDLE` उस proxy के CA bundle पर, ताकि gateway api.roboflow\.com और repo.roboflow\.com के साथ अपनी connections पर भरोसा करे:

```
-e TLS_CA_BUNDLE=/etc/ssl/certs/corporate-ca.pem
```

## Inference Servers को जोड़ना

प्रत्येक Inference Server को gateway की ओर इंगित करें `SECURE_GATEWAY` environment variable के साथ। इसे gateway के hostname या IP address पर, बिना scheme के, सेट करें। तब Inference Server अपनी Roboflow API calls और model weight downloads को सीधे internet तक पहुँचने के बजाय gateway के माध्यम से route करता है।

```
sudo docker run --net=host \
    --env SECURE_GATEWAY=10.0.1.1 \
    roboflow/inference-server:cpu
```

यदि gateway 80 के अलावा किसी और port पर सुनता है, तो उसे शामिल करें, उदाहरण के लिए `SECURE_GATEWAY=10.0.1.1:8080`. Inference Server इस address पर HTTP के माध्यम से gateway से जुड़ता है, इसलिए पुष्टि करें कि host और port Inference Server के network से पहुँच योग्य हैं।

केवल gateway को api.roboflow\.com और repo.roboflow\.com तक outbound access चाहिए। Inference Server शुरू होने के बाद, एक model चलाएँ और पुष्टि करें कि requests gateway के access logs में दिखाई दें।

पुराना `LICENSE_SERVER` variable अभी भी `SECURE_GATEWAY`के लिए alias के रूप में स्वीकार किया जाता है, इसलिए मौजूदा deployments काम करते रहते हैं। यह deprecated है और Q3 2026 के अंत में हटाने की योजना है।

## Caching

Secure Gateway प्रत्येक response को पहली download पर cache करता है, content कितनी बार बदलता है उसके आधार पर tiered। Content-addressed container blobs और model weights को सबसे लंबे समय तक रखा जाता है, और mutable API responses को कम समय के लिए। किसी भी Inference Server से आने वाले subsequent requests cache से serve किए जाते हैं, जिससे bandwidth use और एक fleet में cold starts कम होते हैं।
