【问题标题】:How to setup Nginx on OpenShift?如何在 OpenShift 上设置 Nginx?
【发布时间】:2017-04-23 19:07:03
【问题描述】:

我创建了一个 DIY 墨盒,因为我需要运行在 PHP 5.6 上运行的应用程序我已按照此链接中的说明进行操作:How to install Nginx on OpenShift

但是,我收到此错误:“服务暂时不可用 由于维护停机或容量问题,服务器暂时无法满足您的请求。请稍后再试。 Apache/2.2.15 (Red Hat) 服务器在 myapp.rhcloud.com 端口 80"

我认为错误可能与 .openshift/action_hooks/start 脚本有关:

#!/bin/bash
# The logic to start up your application should be put in this
# script. The application will work only if it binds to
# $OPENSHIFT_DIY_IP:8080
#nohup $OPENSHIFT_REPO_DIR/diy/testrubyserver.rb $OPENSHIFT_DIY_IP $OPENSHIFT_REPO_DIR/diy |& /usr/bin/logshifter -tag diy &
# replace the $OPENSHIFT_INTERNAL_IP and $OPENSHIFT_INTERNAL_PORT before starting up the server
sed -e "s/`echo '$OPENSHIFT_IP:$OPENSHIFT_PORT'`/`echo $OPENSHIFT_DIY_IP:$OPENSHIFT_DIY_PORT`/" $OPENSHIFT_DATA_DIR/conf/nginx.conf.template > $OPENSHIFT_DATA_DIR/conf/nginx.conf
nohup $OPENSHIFT_DATA_DIR/sbin/nginx > $OPENSHIFT_DIY_LOG_DIR/server.log 2>&1 &

当我运行 rhc tail -a myapp

Unable to connect to the server (getaddrinfo: Temporary failure in name
resolution (https://openshift.redhat.com:443)). Check that you have correctly
specified your OpenShift server 'https://openshift.redhat.com/broker/rest/api'.

可能出了什么问题?谢谢。

【问题讨论】:

    标签: nginx openshift


    【解决方案1】:

    OpenShift Online https://status.openshift.com 面临中断。不是今天,最近我又面对了两天。

    我部署以使用this repo on GitHub 进行测试。

    curl -I http://myapp-abhishekghosh.rhcloud.com  
    HTTP/1.1 200 OK
    Date: Sun, 23 Apr 2017 20:06:16 GMT
    Server: nginx/1.11.1
    Content-Type: text/html
    Content-Length: 41217
    Last-Modified: Sun, 23 Apr 2017 19:49:40 GMT
    Vary: Accept-Encoding
    ETag: "58fd0554-a101"
    Accept-Ranges: bytes
    

    可以看到Nginx的裸404页面——http://myapp-abhishekghosh.rhcloud.com/broker/rest/api

    我无法克隆,因为身份验证服务失败。

    最近我发现 IBM Bluemix 对某些东西更加友好,因为 OpenShift 缺乏对它们的官方支持。你可以看看他们的一个应用程序,他们有 Nginx 配置,在我看来很正常——https://github.com/IBM-Bluemix/lets-chat-bluemix/blob/master/nginx/nginx.conf。此刻,我对 IBM Bluemix 的经验确实最少。

    其次,Aruba 云每月有 1 欧元(加上增值税)1 GB VMWare 服务器。

    我们所有人都曾在 Heroku PaaS 背后付出了巨大的努力。我们需要在他们的系统背后付出这么多毫无意义的努力吗?可能因人而异。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-30
    • 2015-11-14
    • 2021-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-15
    相关资源
    最近更新 更多