> 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/deployment/hi/self-hosted/enterprise/secure-gateway.md).

# Secure Gateway

Secure Gateway, Roboflow API और आपके मॉडल के वेट्स के लिए एक proxy है, जब आप Roboflow Inference Server को इंटरनेट से firewall करते हैं। यह इसका उत्तराधिकारी है [License Server](/deployment/hi/self-hosted/enterprise/license-server.md) और मॉडल वेट्स तथा कंटेनर इमेजों का स्थानीय कैशिंग जोड़ता है, ताकि inference servers का एक बेड़ा बाहर जाने के लिए एक ही नियंत्रित बिंदु साझा करे।

{% hint style="info" %}
यह पृष्ठ आवश्यक बातें कवर करता है। पूर्ण कॉन्फ़िगरेशन और संचालन संदर्भ के लिए, देखें the [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+ मेमोरी
* कैश के लिए एक S3 bucket, या 50GB+ स्थानीय disk

{% hint style="info" %}
Red Hat Enterprise Linux पर deploy कर रहे हैं? [Podman के साथ RHEL पर Secure Gateway](/deployment/hi/self-hosted/enterprise/secure-gateway-podman.md) Docker या Kubernetes के बिना RHEL hosts को कवर करता है, और [MicroShift पर Secure Gateway](/deployment/hi/self-hosted/enterprise/secure-gateway-microshift.md) MicroShift चला रहे Red Hat Device Edge hosts को कवर करता है। दोनों समान air-gapped bundle मॉडल के साथ समर्पित installers का उपयोग करते हैं।
{% endhint %}

## Secure Gateway का उपयोग

ऐसी मशीन पर, जिसकी पहुँच है `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
```

यह `नवीनतम` tag सबसे हालिया release को track करता है। उत्पादन के लिए, और खासकर air-gapped deployments के लिए, इसके बजाय एक विशिष्ट version pin करें, ताकि upgrades जानबूझकर और दोहराने योग्य रहें, उदाहरण के लिए `repo.roboflow.com/roboflow-edge/secure-gateway:0.2.0`.

इसे स्थानीय 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। किसी instance या IAM role का उपयोग करने के लिए credentials को unset ही छोड़ दें।

## TLS प्रमाणपत्र

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

```
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` इनबाउंड HTTPS सक्षम करने के लिए आवश्यक हैं, और प्रत्येक PEM-encoded फ़ाइल की ओर संकेत करता है।

जब 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 को सीधे इंटरनेट तक पहुँचने के बजाय gateway के माध्यम से भेजता है।

```
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`. बिना scheme वाला मान इस रूप में माना जाता है `http://`, इसलिए Inference Server इस address पर HTTP के माध्यम से gateway से जुड़ता है। पुष्टि करें कि host और port Inference Server के network से पहुँच योग्य हैं।

यदि आपका gateway साधारण HTTP के बजाय HTTPS परोसता है, जैसा कि [Podman के साथ RHEL](/deployment/hi/self-hosted/enterprise/secure-gateway-podman.md) और [MicroShift](/deployment/hi/self-hosted/enterprise/secure-gateway-microshift.md) दोनों deployments करते हैं, तो मान में scheme रखें (`SECURE_GATEWAY=https://gateway.example.com`) और सुनिश्चित करें कि Inference Server gateway के certificate पर भरोसा करता है।

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

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

## कैशिंग

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