Bug 1022956 - HTTP GET request method to deployed Openshift application's URL with specified HTTP port 80 is redirected to weird HTTPS address.
Summary: HTTP GET request method to deployed Openshift application's URL with specifie...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: mfisher
QA Contact: libra bugs
URL:
Whiteboard:
: 1028091 (view as bug list)
Depends On:
Blocks: 1025307
TreeView+ depends on / blocked
 
Reported: 2013-10-24 11:09 UTC by Emil Cervenan
Modified: 2015-05-14 23:31 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1025307 (view as bug list)
Environment:
Last Closed: 2013-12-17 19:55:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1028091 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1028091

Description Emil Cervenan 2013-10-24 11:09:36 UTC
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:
Always

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

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://testapp-wfkqa.rhcloud.com:80/app">here</a>.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at testapp-wfkqa.rhcloud.com Port 80</address>
</body></html>


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 12:47:25 UTC
This behaviour is not restricted to jbosseap cartridge only. See Additional info.

Comment 2 Rob Millner 2013-10-24 18:25:02 UTC
Modified the regular expressions to strip port number off the host header when we construct an app name for matching.

https://github.com/openshift/origin-server/pull/3982

$ 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-25 01:36:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a5930b7dd00f5bf3171ef8e4ef03f198b0401a1b
Bug 1022956 - Strip trailing port number off the host header.

Comment 4 Meng Bo 2013-10-28 10:59:50 UTC
# 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 16:18:32 UTC
*** Bug 1028091 has been marked as a duplicate of this bug. ***

Comment 7 Andy Grimm 2013-12-17 19:55:09 UTC
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.