How to install Nginx on OpenShift

Although I followed https://blog.openshift.com/lightweight-http-serving-using-nginx-on-openshift/ step by step , I got a 503 error stating that the service was not available. There are questions on various sites, including stackoverflow, but they are all related to issues after successfully installing nginx, a point I haven't arrived at yet.

I don't want to use the cartridges I already have - in part because most of them are outdated. Also, the answer to my question may be of interest to some people as it teaches how to always run the latest nginx server on OpenShift.

This is the result rhc tail

DL is deprecated, please use Fiddle
==> app-root/logs/diy.log <==
[2014-12-06 16:55:47] INFO  WEBrick::HTTPServer#start done.
[2014-12-06 16:55:50] INFO  WEBrick 1.3.1
[2014-12-06 16:55:50] INFO  ruby 1.8.7 (2013-06-27) [x86_64-linux]
[2014-12-06 16:55:50] INFO  WEBrick::HTTPServer#start: pid=255959 port=8080
127.xx.x.xxx - - [06/Dec/2014:17:11:57 EST] "HEAD / HTTP/1.1" 200 0
- -> /
127.xx.x.xxx - - [06/Dec/2014:17:11:57 EST] "HEAD / HTTP/1.1" 200 0
- -> /
[2014-12-06 17:32:02] INFO  going to shutdown ...
[2014-12-06 17:32:02] INFO  WEBrick::HTTPServer#start done.

==> app-root/logs/server.log <==
nginx: [emerg] invalid port in ":" of the "listen" directive in /var/lib/openshi
ft/xxx/app-root/data//conf/nginx.conf:36

      

+3


source to share


3 answers


This tutorial (2012) uses environment variables: $ OPENSHIFT_INTERNAL_IP: $ OPENSHIFT_INTERNAL_PORT



It has now been renamed to:
$ OPENSHIFT_DIY_IP: $ OPENSHIFT_DIY_PORT

+2


source


If all you want is nginx on OpenShift I would use this cartridge



https://github.com/gsterjov/openshift-nginx-cartridge

+1


source


Here is the cartridge updated to the most recent nginx 1.9.12

0


source







All Articles