Posts

Showing posts from November, 2015

Setting Default Application in Openshift Nodes

Image
Background The default behavior of Openshift nodes is to redirect requests for unknown applications to host/getting_started.html, usually causing endless redirect loop. On some cases we might want this behavior to be changed, for example when we want a default page (Application not found) to show up. Or when tools such as Acunetix scanning tool incorrectly detected such redirect as medium vulnerability because the redirect uses the injected host header. The Openshift Origin platform in use for this article is Origin Release 4, with the nodes using apache-mod-rewrite frontent plugin (rubygem-openshift-origin-frontend-apache-mod-rewrite-0.7.1.1-1.el6.noarch).  Mechanism The default mechanism can be read in /etc/httpd/conf.d/000001_openshift_origin_node.conf : As we can see, routes are loaded from openshift_route.include.  The file is full of route rules, but the interesting part are the RewriteMap clauses in the top of the file : Nodes and aliases are loaded f