用于节点应用程序的HTTPS的Openshift进程环境变量

时间:2023-01-14 17:12:17

OpenShift has a OPENSHIFT_NODEJS_PORT process.env variable which works well with HTTP.

OpenShift有一个OPENSHIFT_NODEJS_PORT process.env变量,可以很好地与HTTP配合使用。

However, I could not find any information about HTTPS. Is there another process.env variable for it? Or should I use OPENSHIFT_NODEJS_PORT for HTTPS too?

但是,我找不到任何有关HTTPS的信息。是否有另一个process.env变量?或者我也应该为HTTPS使用OPENSHIFT_NODEJS_PORT吗?

1 个解决方案

#1


3  

https is terminated at the node level proxy that is in front of your gear, so the ssl never actually reaches your gear directly. You should just write your application as if it is using http and it will be fine. if you need to determine whether or not it was accessed via https, look for the x-forwarded-for http header.

https在您的齿轮前面的节点级代理处终止,因此ssl实际上从未直接到达您的齿轮。您应该像使用http一样编写应用程序,它会没问题。如果您需要确定是否通过https访问它,请查找x-forwarded-for http标头。

#1


3  

https is terminated at the node level proxy that is in front of your gear, so the ssl never actually reaches your gear directly. You should just write your application as if it is using http and it will be fine. if you need to determine whether or not it was accessed via https, look for the x-forwarded-for http header.

https在您的齿轮前面的节点级代理处终止,因此ssl实际上从未直接到达您的齿轮。您应该像使用http一样编写应用程序,它会没问题。如果您需要确定是否通过https访问它,请查找x-forwarded-for http标头。