Bug 1022956 - HTTP GET request method to deployed Openshift application's URL with specified HTTP port 80 is redirected to weird HTTPS address.
HTTP GET request method to deployed Openshift application's URL with specifie...
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: mfisher
libra bugs
: 1028091 (view as bug list)
Depends On:
Blocks: 1025307
  Show dependency treegraph
Reported: 2013-10-24 07:09 EDT by Emil Cervenan
Modified: 2015-05-14 19:31 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1025307 (view as bug list)
Last Closed: 2013-12-17 14:55:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Emil Cervenan 2013-10-24 07:09:36 EDT
Description of problem:
HTTP GET request to deployed application on Openshift with specified HTTP port 80 (jbosseap cartridge) returns "302 Found" redirection to weird HTTPS address https://appname-namespace.rhcloud.com:80/app. Without specified port 80 Openshift behaves normally and returns "200 OK".

Version-Release number of selected component (if applicable):
Openshift online

How reproducible:

Steps to Reproduce:
1.rhc app create testapp jbosseap --no-git
2.telnet testapp-namespace.rhcloud.com 80
>GET / HTTP/1.1
>Host: testapp-namespace.rhcloud.com:80

Actual results:
HTTP/1.1 302 Found
Date: Thu, 24 Oct 2013 10:43:28 GMT
Server: Apache/2.2.15 (Red Hat)
Location: https://testapp-wfkqa.rhcloud.com:80/app
Content-Length: 316
Content-Type: text/html; charset=iso-8859-1

<title>302 Found</title>
<p>The document has moved <a href="https://testapp-wfkqa.rhcloud.com:80/app">here</a>.</p>
<address>Apache/2.2.15 (Red Hat) Server at testapp-wfkqa.rhcloud.com Port 80</address>

Expected results:
telnet testapp-namespace.rhcloud.com 80
>GET / HTTP/1.1
>Host: testapp-namespace.rhcloud.com

HTTP/1.1 200 OK
Date: Thu, 24 Oct 2013 10:45:37 GMT
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"6763-1382610862000"
Last-Modified: Thu, 24 Oct 2013 10:34:22 GMT
Content-Type: text/html
Content-Length: 6763
Vary: Accept-Encoding

Additional info:
Same behaviour with php, ruby and nodejs cartridges.
Comment 1 Emil Cervenan 2013-10-24 08:47:25 EDT
This behaviour is not restricted to jbosseap cartridge only. See Additional info.
Comment 2 Rob Millner 2013-10-24 14:25:02 EDT
Modified the regular expressions to strip port number off the host header when we construct an app name for matching.


$ nc rmtest-rmillner0160.dev.rhcloud.com 80
GET / HTTP/1.1
Host: rmtest-rmillner0160.dev.rhcloud.com:80

HTTP/1.1 200 OK
Date: Thu, 24 Oct 2013 18:24:38 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 5235
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding,User-Agent
ProxyTime: D=7782218

Comment 3 openshift-github-bot 2013-10-24 21:36:49 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 1022956 - Strip trailing port number off the host header.
Comment 4 Meng Bo 2013-10-28 06:59:50 EDT
# curl -I http://php1-bmengdev.dev.rhcloud.com:80/
HTTP/1.1 200 OK
Date: Mon, 28 Oct 2013 10:50:57 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding,User-Agent
ProxyTime: D=2500

Checked on devenv_3953, the http request return correct code 200.

Move bug to verified.
Comment 6 Andy Grimm 2013-12-10 11:18:32 EST
*** Bug 1028091 has been marked as a duplicate of this bug. ***
Comment 7 Andy Grimm 2013-12-17 14:55:09 EST
This was released to OpenShift Online's production environment in 2.0.36.

Note You need to log in before you can comment on or make changes to this bug.