Connection timeout from work, working anywhere else

Francis Daly francis at
Tue May 5 21:06:49 UTC 2015

On Tue, May 05, 2015 at 04:00:11PM -0400, GuiPoM wrote:

Hi there,

> I just tried to put debug as for example : "access_log
> /var/log/nginx/access.log debug;"
> But: 
> Restarting nginx: nginx: [emerg] unknown log format "debug" in
> /etc/nginx/nginx.conf:36
> nginx: configuration file /etc/nginx/nginx.conf test failed

Does "nginx -V" show "--with-debug"?

"debug" is for error_log, not for access_log.

> 2/ In error log, even if I can't set a debug level, there is already
> something strange I would like to change:
> 2015/05/02 13:25:05 [error] 2144#0: *4926 upstream prematurely closed
> connection while reading response header from upstream, client:
> XX.XX.XXX.XXX, server: , request: "GET
> /
> HTTP/1.1", upstream:
> "",
> host: "", referrer:
> ""
> How host and referrer can be filled with a dynamic dns name ? How nginx is
> aware of this information ? I am requesting with an IP address, so no chance
> this information come from the sender.

When you copy-paste the commands issued and the responses gathered,
it may become clearer where all of the information is coming from.

My guess is that you are issuing one request with an ip address, and
that is returning a http redirect to a hostname; and then you are issuing
the next request to that hostname.

But until you show your work, all anyone can do here is guess.

> Could this configuration be erroneous ?
> (/etc/nginx/sites-enabled/default_ssl)
> location / {
>                 proxy_pass;
>                 proxy_http_version 1.1;
>                 proxy_set_header Upgrade $http_upgrade;
>                 proxy_set_header Connection "Upgrade";
>                 proxy_set_header Host $host;
>                 proxy_redirect off;
>                 proxy_read_timeout 6000;
>         }

This looks like the connection is using WebSockets.

Does your proxy server at work allow WebSocket connections to pass
through it?

Can you successfully connect to any WebSocket service anywhere from
work? If not, the problem may not be on the nginx side.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list