如何在OpenShift Online(Next Gen)开发人员预览中为项目添加自定义主机名 [英] How to add a custom hostname for project in OpenShift Online (Next Gen) Developer Preview

查看:107
本文介绍了如何在OpenShift Online(Next Gen)开发人员预览中为项目添加自定义主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为在 OpenShift(下一代)开发人员预览版中创建的新项目添加自定义主机名?

How can I put a custom host name for the new project created in the OpenShift (Next Gen) Developer Preview?

对于以前的版本来说非常简单,我必须添加一个别名并在DNS中添加所需的CNAME条目.对于此版本,我尝试了CNAME和A.首先,我将CNAME添加到平台提供的默认地址中;然后我尝试将地址的A记录添加到服务中显示的群集IP.不幸的是,这两种方法都无法解决!

It was pretty straight forward for the previous version where I have to add an alias and add the required CNAME entry in DNS. For this version, I tried both CNAME and A. First I add a CNAME to the default address provided by the platform; then I tried adding A record for the address to the Cluster IP shown in the service. Both methods failed to solve it unfortunately!

我可以在站点中看到一个路由器对象,但不确定该怎么做!

I can see a router object in the site but not sure what to do!

有人知道吗?

推荐答案

目前,开发人员预览版不允许您通过平台本身添加自定义主机名. OpenShift确实支持该概念,但目前已被禁用.

At this point in time, the developer preview does not permit you to add a custom hostname through the platform itself. OpenShift does support the concept, but it is disabled for now.

目前可获得相同结果的唯一方法是在CDN(例如CloudFlare)或OpenShift之外的自己的单独代理之后运行您的站点,并终止对您的自定义主机名的请求,然后转发该请求

The only way to can achieve the same result at the moment is to run your site behind a CDN such as CloudFlare, or your own separate proxy outside of OpenShift, with those terminating the request for your custom host name and then forwarding it.

也就是说,如果启用该功能,通常将通过使用指定的主机名创建一条新路由来完成.

That said, how it would usually be done if enabled is by creating a new route with the specified hostname.

oc expose service myapp --name myapp-public --hostname www.example.com

这篇关于如何在OpenShift Online(Next Gen)开发人员预览中为项目添加自定义主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆