Nginx – 502 Bad Gateway Nginx

502gatewaynginx

When I try to view my website homepage I get the following error dislayed: 502 Bad Gateway Nginx

The error log found at /var/log/nginx shows the message: *2014/04/21 10:30:39 [error] 3807#0: 228 upstream sent invalid header while reading response header from upstream, client: 95.136.96.5, server: agronegocios.eu, request: "GET / HTTP/1.1", upstream: (MyIPaddress):7080/", host: "agronegocios.eu"

My environment: CentOS 6.5; PHP 5.3.3; nginx/1.5.0; MySQL 5.1.73; Joomla 3.2.3
Anyone know how can I get rid of this problem? I´ve seen some related questions and answers but none is to the same problem…(and also I'm not an expert on linux servers…).
Thanks.

My nginx.conf file:

#user  nginx;
worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;


events {
  worker_connections  1024;
}


http {
  include       mime.types;
  default_type  application/octet-stream;

  #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  #                  '$status $body_bytes_sent "$http_referer" '
  #                  '"$http_user_agent" "$http_x_forwarded_for"';

  #access_log  /var/log/nginx/access.log  main;

  sendfile        on;
  #tcp_nopush     on;

  #keepalive_timeout  0;
  keepalive_timeout  65;
  #tcp_nodelay        on;

  #gzip  on;
  #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

fastcgi_buffers 8 16k;
  fastcgi_buffer_size 32k;
  server_tokens off;

  include /etc/nginx/conf.d/*.conf;
}

Best Answer

I detected where (yet not what) was causing the error: a template module in the CMS extensions that is not working properly. Disabling the module made the error go away. Anyway, thanks for your opinions and efforts!