Welcome! Log In Create A New Profile

Advanced

Re: 502 Bad Gateway when downloading file

Maxim Dounin
October 16, 2011 08:32AM
Hello!

On Sun, Oct 16, 2011 at 07:24:34AM -0400, sogi wrote:

> Hello.
> Many thanks for your reply.
> We are changing headers through PHP header() function.
>
> Header is dispatching correctly from HAPROXY. It is as follows:
> HTTP/1.1 200 OK
>
>
> Date: Fri, 14 Oct 2011 01:18:08 GMT
>
>
> Server: Apache/2.2.16 (Debian)
>
>
> X-Powered-By: PHP/5.2.10
>
>
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
>
>
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
>
> Pragma: no-cache
>
>
> Content-Length: 77032;

The ";" is incorrect and shouldn't be here. If it's indeed
present in headers returned by your backend - there is no surprise
haproxy rejects such responses (see below).

>
>
> Content-Disposition: attachment; filename="aaaa.txt"
>
>
> Connection: close
>
>
> Content-Type: application/txt
>
> Logs from nginx debug:
> http://pastebin.com/UrMXgYyf
> (I have more - all from logging into system to 502, but there are so
> large actually :) )

Debug log shows response from backend was already 502:

2011/10/13 21:47:05 [debug] 15881#0: *33 http proxy status 502 "502 Bad Gateway"

That is, most likely it's haproxy who returned 502. See above for
possible reason.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

502 Bad Gateway when downloading file

sogi October 15, 2011 07:51PM

Re: 502 Bad Gateway when downloading file

stefancaunter October 16, 2011 03:36AM

Re: 502 Bad Gateway when downloading file

sogi October 16, 2011 07:24AM

Re: 502 Bad Gateway when downloading file

Maxim Dounin October 16, 2011 08:32AM

Re: 502 Bad Gateway when downloading file

sogi October 16, 2011 10:15AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready