[ome-users] Nginx 502 Bad Gateway

Harri Jäälinoja harri.jaalinoja at helsinki.fi
Mon Mar 19 15:39:35 GMT 2012


Hi all,
I have problems setting up OMERO.web. I decided to go for nginx so that 
I don't have to worry about compiling the FastCGI module.

System info:
- I am using OMERO 4.3.3.
- OS: Red Hat Enterprise Linux Server release 5.8 (Tikanga)
- nginx 0.8.55-1
[root at lmu-omero2 nginx]# yum list |grep nginx
nginx.x86_64                        0.8.55-1.el5            installed 

collectd-nginx.x86_64               4.10.3-1.el5            epel 



The error messages:

On the browser I get
"502 Bad Gateway".

I log file I get this:
2012/03/19 17:08:34 [error] 2062#0: *5 upstream sent unsupported FastCGI 
protocol version: 60 while reading response header from upstream, 
client: 128.214.89.14, server: _, request: "GET / HTTP/1.1", upstream: 
"fastcgi://0.0.0.0:4080", host: "lmu-omero2.biocenter.helsinki.fi"

In OMEROweb.log I have:
Mon, 19 Mar 2012 17:10:13 root         INFO     Application Starting...


This is the configuration:

[omero at lmu-omero2 ~]$ omero config get|grep web
omero.web.application_host=http://lmu-omero2.biocenter.helsinki.fi:80/
omero.web.application_server=fastcgi-tcp
omero.web.email_host=lmu-omero2.biocenter.helsinki.fi
omero.web.server_email=omero at lmu-omero2.biocenter.helsinki.fi

[omero at lmu-omero2 ~]$ omero web config nginx
pid /opt/OMERO/OMERO.server-Beta-4.3.3/var/pid.nginx;
error_log /opt/OMERO/OMERO.server-Beta-4.3.3/var/log/nginx_error.log;
worker_processes  5;
working_directory /opt/OMERO/OMERO.server-Beta-4.3.3/var;

events {
     worker_connections  1024;
}


http {
     access_log 
/opt/OMERO/OMERO.server-Beta-4.3.3/var/log/nginx_access.log;
     include       /opt/OMERO/OMERO.server-Beta-4.3.3/etc/mime.types;
     default_type  application/octet-stream;
     client_body_temp_path /opt/OMERO/OMERO.server-Beta-4.3.3/var/nginx_tmp;

     keepalive_timeout  65;

     server {
         listen       80;
         server_name  _;
         fastcgi_temp_path /opt/OMERO/OMERO.server-Beta-4.3.3/var/nginx_tmp;
         proxy_temp_path /opt/OMERO/OMERO.server-Beta-4.3.3/var/nginx_tmp;

          # weblitz django apps serve media from here
         location /appmedia {
             alias 
/opt/OMERO/OMERO.server-Beta-4.3.3/lib/python/omeroweb/media;
         }

         # django's admin media
         location /media {
             alias 
/opt/OMERO/OMERO.server-Beta-4.3.3/lib/python/omeroweb/media/django_admin_media;
         }

         location / {
             if (-f 
/opt/OMERO/OMERO.server-Beta-4.3.3/var/maintenance.html) {
                error_page 503 /maintenance.html;
                return 503;
             }
             fastcgi_pass 0.0.0.0:4080;
             fastcgi_param PATH_INFO $fastcgi_script_name;
             fastcgi_param REQUEST_METHOD $request_method;
             fastcgi_param QUERY_STRING $query_string;
             fastcgi_param CONTENT_TYPE $content_type;
             fastcgi_param CONTENT_LENGTH $content_length;
             fastcgi_param SERVER_NAME $server_name;
             fastcgi_param SERVER_PROTOCOL $server_protocol;
             fastcgi_param SERVER_PORT $server_port;
             fastcgi_pass_header Authorization;
             fastcgi_intercept_errors on;
             fastcgi_read_timeout 300;
         }

         location /maintenance.html {
             root /opt/OMERO/OMERO.server-Beta-4.3.3/var;
         }

     }

}

There may be some issue with permissions:
[omero at lmu-omero2 ~]$ ls -l /opt/OMERO/OMERO.server-Beta-4.3.3/var
total 24
-rw-r--r-- 1 omero omero    5 Mar 19 17:10 django.pid
drwxrwxr-x 2 omero omero 4096 Mar 16 17:33 log
drwxrwxr-x 5 omero omero 4096 Mar 14 17:18 master
drwx------ 2 nginx root  4096 Mar 16 17:33 nginx_tmp
-rw-r--r-- 1 root  root     5 Mar 19 13:20 pid.nginx
drwxrwxr-x 2 omero omero 4096 Mar 14 17:18 registry


[omero at lmu-omero2 ~]$ omero admin diagnostics
FATAL: Cannot access /opt/OMERO/OMERO.server-Beta-4.3.3/var/nginx_tmp, a 
required file/directory for OMERO

What should I change?

Thanks in advance, best regards,
Harri

-- 
__________________________________________________
Harri Jäälinoja
Light Microscopy Unit
Institute of Biotechnology, University of Helsinki
http://www.biocenter.helsinki.fi/bi/lmu/
+358 9 191 59370 fax +358 9 191 59366




More information about the ome-users mailing list