没有不值得去解决的问题,也没有不值得去学习的技术!

Implementing ccpapi.xxx.cn to apiv2.xxx.cn/ccpapi in Konga

The current domain is apiv2.xxx.cn/ccpapi. It can be called normally from the external network. However, the request received by the server is: http://api.ccp:82.

1. The current domain is ccpapi.xxx.cn. It can be called normally from the external network. See Figure 1.

The current domain is ccpapi.xxx.cn. It can be called normally from the external network.
Figure 1

2. The current Rancher configuration and load balancing. See Figure 2.

The current Rancher configuration and load balancing.
Figure 2

3. In Konga, go to SERVICES – ADD NEW SERVICE. Name: api_ccp. Url: http://api.ccp:82. Fill in only these 2 fields. Submit. See Figure 3.

In Konga, go to SERVICES - ADD NEW SERVICE. Name: api_ccp. Url: http://api.ccp:82. Fill in only these 2 fields. Submit.
Figure 3

4. In Konga, under SERVICES, view the details of api_ccp. The Url value has been automatically split into 3 fields (Protocol, Host, Port). See Figure 4.

In Konga, under SERVICES, view the details of api_ccp. The Url value has been automatically split into 3 fields (Protocol, Host, Port).
Figure 4

5. In Konga, go to SERVICES – Service api_ccp (note: the name was slightly modified) – Routes – ADD ROUTE. Name: ccpapi. Paths: /ccpapi. Submission failed with error: Submission failed. schema violation (must set one of ‘methods’, ‘hosts’, ‘headers’, ‘paths’, ‘snis’ when ‘protocols’ is ‘https’). See Figure 5.

In Konga, go to SERVICES - Service api_ccp (note: the name was slightly modified) - Routes - ADD ROUTE. Name: ccpapi. Paths: /ccpapi. Submission failed with error: Submission failed. schema violation (must set one of 'methods', 'hosts', 'headers', 'paths', 'snis' when 'protocols' is 'https').
Figure 5

6. In the Paths field, press the Enter key. For Protocols: http, https, press the Enter key. Submit. See Figure 6.

In the Paths field, press the Enter key. For Protocols: http, https, press the Enter key. Submit.
Figure 6

7. In Rancher, go to Workloads – Upgrade Service – Port Mapping – Add Rule. See Figure 7.

In Rancher, go to Workloads - Upgrade Service - Port Mapping - Add Rule.
Figure 7

8. The current Rancher configuration and load balancing. Delete the rule: ccpapi.xxx.cn. See Figure 8.

The current Rancher configuration and load balancing. Delete the rule: ccpapi.xxx.cn.
Figure 8

9. The current domain is apiv2.xxx.cn/ccpapi. It can be called normally from the external network. However, the request received by the server is: http://api.ccp:82. See Figure 9.

The current domain is apiv2.xxx.cn/ccpapi. It can be called normally from the external network. However, the request received by the server is: http://api.ccp:82.
Figure 9

 

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系