如何在 Openshift 上为 Node cartridge 公开端口 80?
How to expose port 80 for Node cartridge on Openshift?
在 Openshift 上,Node cartridge 在 OPENSHIFT_NODEJS_PORT 上公开,默认为端口 8080。是否可以为同一个应用程序也公开端口 80?一次一个,或同时两个,都没有关系。
如果我在端口 8080 上调用应用程序,我可以访问它。如果我在端口 80 上调用它,我不会得到任何响应。在应用程序中,我绑定到 OPENSHIFT_NODEJS_PORT (8080)。我需要做什么才能访问端口 80 上的应用程序?
端口 8080 通过端口 80 向外部重新路由。无法在应用程序上公开端口 80。查看文档中的 Binding Applications to Ports。
文档中最相关的注释:
All ports less than 1024 are reserved for OpenShift Online operations, and developers cannot bind to these ports. However, ports greater than 1024 are available for binding, and the following table shows the commonly used ports.
...
Ports 15000 - 35530 are available for binding internal IP, but these ports are not externally addressable. You can also bind to $OPENSHIFT_Cart_Name_PORT
(8080) for HTTP connectivity, which reroutes externally through port 80.
在 Openshift 上,Node cartridge 在 OPENSHIFT_NODEJS_PORT 上公开,默认为端口 8080。是否可以为同一个应用程序也公开端口 80?一次一个,或同时两个,都没有关系。
如果我在端口 8080 上调用应用程序,我可以访问它。如果我在端口 80 上调用它,我不会得到任何响应。在应用程序中,我绑定到 OPENSHIFT_NODEJS_PORT (8080)。我需要做什么才能访问端口 80 上的应用程序?
端口 8080 通过端口 80 向外部重新路由。无法在应用程序上公开端口 80。查看文档中的 Binding Applications to Ports。
文档中最相关的注释:
All ports less than 1024 are reserved for OpenShift Online operations, and developers cannot bind to these ports. However, ports greater than 1024 are available for binding, and the following table shows the commonly used ports.
...
Ports 15000 - 35530 are available for binding internal IP, but these ports are not externally addressable. You can also bind to
$OPENSHIFT_Cart_Name_PORT
(8080) for HTTP connectivity, which reroutes externally through port 80.