Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

http: proxy error: malformed HTTP response "" #127

Open
oskarpearson opened this issue Jul 19, 2015 · 1 comment
Open

http: proxy error: malformed HTTP response "" #127

oskarpearson opened this issue Jul 19, 2015 · 1 comment

Comments

@oskarpearson
Copy link

Hi

This might be more of an "FYI" than a bug - but I thought it was worth noting.

I've just had an issue pointing the proxy at Nginx (running mediawiki and php5-fpm).

On a small percentage of requests, I'd receive this error from oauth2_proxy. It mostly occurred on reloads (which probably meant that if-modified-since request was being sent - which might return a blank body):

http: proxy error: malformed HTTP response ""

After some debugging, I found that turning off keepalives on the "upstream" nginx solved the problem:

/etc/nginx/sites-available/whatever-upstream:

keepalive_timeout 0;

I've got a network dump that appears to include nginx responding with an extraneous blank line in the 304 not modified response. I'm not sure if there's anything oauth2 proxy can do to ignore this, or if I should be logging something with the nginx folk... :)

GET ...  HTTP/1.1
Host: ...
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Authorization: Basic b3NrYXIucGVhcnNvbjo=
Cache-Control: max-age=0
Cookie: ...
Dnt: 1
If-Modified-Since: Sun, 19 Jul 2015 18:42:34 GMT
Referer: https://...
X-Forwarded-Email: ...
X-Forwarded-For: 127.0.0.1
X-Forwarded-User: ...
X-Real-Ip: ...
X-Scheme: https

HTTP/1.1 304 Not Modified
Server: nginx/1.4.6 (Ubuntu)
Date: Sun, 19 Jul 2015 18:59:29 GMT
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.11
X-Content-Type-Options: nosniff



GET /skins/common/images/Unboxed_logo_wiki.gif HTTP/1.1

Version info:

  • oauth2_proxy-2.0.1.linux-amd64.go1.4.2
  • Ubuntu 14.04.2 LTS
  • 1.4.6-1ubuntu3.2
@jehiah
Copy link
Member

jehiah commented Jul 24, 2015

@oskarpearson Thanks for taking the time to report this. It's also to me why this might be happening, but i'll try to do some investigating in case this is a problem on the oauth2_proxy side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants