Actually if you are getting a 404, that is still a response code from a listening server. Maybe it is redirecting wrongly with the external address? If you were getting a 502 or 503, that would be a good sign nothing was listening in the gear.
----- Original Message -----
From: "Zamir SUN" <zsun fedoraproject org>
To: dev lists openshift redhat com
Sent: Saturday, January 10, 2015 10:01:56 PM
Subject: How to make a port accessible out of the gear in online?
Recently I am trying to run a python application on OpenShift. It uses
Redis and WSGIServer from gevent.wsgi. So I created a python app and
then followed the link  and link .
I just commented out the httpd = make_server('localhost', 8051,
application) and httpd.handle_request() in wsgi.py and make the app to
listen on port like this:
ip = os.environ['OPENSHIFT_PYTHON_IP']
port = int(os.environ['OPENSHIFT_PYTHON_PORT'])
http_server = WSGIServer((ip, port), app)
However, if I access directly from the browser using
I will always get 404. But if I use port-forward to make it accessible
by 127.0.0.1:8080, it works well. So I wonder if this is a bug with
something or I missed some steps?
FYI, I pushed the whole app to github.
zsun fedoraproject org
zsun in #fedora-zh #openshift on freenode.net