# 如何为NextCLi跳板机绑定域名

## 一、NextCLi跳板机系统绑定域名 <a href="#nextcli-domain" id="nextcli-domain"></a>

* 默认安装完NextCLi系统后， 使用 <http://IP:8088> 即可访问跳板机，通过遗下4步即可使用https+域名，如：<https://demo.nextcli.com> 加密访问跳板机；

1、安装宝塔纯净版 <https://www.hostcli.com/>&#x20;

Centos 7.6 全新安装命令：

```
yum install -y wget && wget -O install.sh http://v7.hostcli.com/install/install_6.0.sh && sh install.sh
```

2、网站 --> 新加站点 --> 添加域名，并将域名指向本服务器IP

&#x20;     如未安装Nginx，请先安装后再创建站点，如图：

![](/files/CXb7PK7wKsjn5548GkK7)

<mark style="color:red;">**如果需要原来的 <http://ip:8088> 可以继续访问，需要在宝塔->安全中放行8088端口；**</mark>

&#x20;<mark style="color:red;">**因为宝塔默认没有放行这个端口**</mark>。

3、如果需要开启HTTPS，请在上述站点 SSL证书处，申请免费证书即可；[申请宝塔免费证书教程>>](https://docs.gfwvip.com/#step5)

<mark style="color:green;">如果该域名使用的解析（如：CloudFlare）包含SSL，则此处无需再申请证书即可直接使用https访问反代的域名，如：</mark> <mark style="color:green;"></mark><mark style="color:green;">**https**</mark><mark style="color:green;">://demo.nextcli.com</mark>

* <mark style="color:green;">**不建议开启CloudFlare等CDN**</mark><mark style="color:green;">，因为NextCLi跳板机使用最优质的香港线路，访问速度非常快，再套上CDN只会降低访问速度。</mark>
* 文件验证、DNS验证两种方式均可申请，文件验证最方便，只需要把域名解析到当前服务器IP即可，需要先把域名解析到本台服务器IP

![两种方式均可申请，需要先把域名解析道本台服务器IP](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjiR3t04ay90Ea9V3I6ju%2Fuploads%2FpnP6cPx3WPWMGbUw5Vmn%2Fimage.png?alt=media\&token=79972af4-e1ea-40fe-8497-15cad8facc80)

* 跳板机本身就是相对干净、安全的机器IP，也不用来建站，一般没必要再套一层CDN代理。
* 特别不建议给该域名(如图示例中的 “demo.nextcli.com” ) 开启CloudFlare的免费代理CDN，因为CF的CDN是美国IP，会绕道美国，严重拖慢速度。
* 如果想要更安全，可以在Windows里再开一个VPN或者Clash、机场等，这样出口IP就是VPN的IP；

4、站点设置 --> 反向代理 --> 添加反向代理：

&#x20;   <mark style="color:red;">**开启代理**</mark>

&#x20;   目标URL：<mark style="color:red;">**<http://127.0.0.1:8088>**</mark>

![](/files/iBXbFk6gHmixemDaK8y4)

5、保存反向代理后，编辑 **该反向代理的【配置文件】**，在18行处添加以下三行，然后保存。

&#x20;    宝塔7.9以上的新版本nginx1.2以后的版本可能已经有这3行在11～13行，无需再添加。

> <mark style="color:red;">proxy\_http\_version 1.1;</mark>
>
> <mark style="color:red;">proxy\_set\_header Upgrade $http\_upgrade;</mark>
>
> <mark style="color:red;">proxy\_set\_header Connection "upgrade";</mark>

![](/files/EHF06N5swu0uvYR2OUlE)

到此位置，已经可以打开 <https://demo.nextcli.com> ，不需要使用 <http://IP:8088> 进行访问跳板机

### 二、为域名开启CDN

域名开不开CDN无所谓，虽然多套一层代理更安全，<mark style="color:orange;">**在国内的用户不推荐给网站开CDN，会很慢**</mark>；

因为跳板机系统主要是香港IP线路，可以给您电脑本地[使用香港VPN、机场代理访问](/jumpserver/security.md#v2ray)跳板机即可；

{% tabs %}
{% tab title="CloudFlare" %}

#### 开启代理 <a href="#open-cf" id="open-cf"></a>

即为使用CloudFlare的免费CDN，免费版一般是美国IP，国内打开速度较慢，请根据自己情况是否开启或关闭；

![ 开启勾选、保存即可](/files/PWmufvgOLgZ8k174t4Rb)

#### 关闭代理 <a href="#off-cf" id="off-cf"></a>

关闭即不使用CF的网址，域名直接指向真实IP。

![取消代理状态后，点击保存即可](/files/Xqu5eRDbWN76I1yHemvO)
{% endtab %}

{% tab title="其他云服务器CDN" %}
参考其他CDN厂商、客服的教程自行开启；
{% endtab %}
{% endtabs %}


---

# 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://docs.nextcli.com/jumpserver/nextcli-domain.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.
