We're Hiring!

Getting "upstream directive is not allowed here " error

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Getting "upstream directive is not allowed here " error

Postby tinat » Tue Apr 23, 2019 1:16 am

Hello,

I am running OMERO 5.4.10 on Ubuntu 16.04 with nginx 1.10.3

I had started OMERO.server with the command: OMERO.server/bin/omero admin start
And OMERO.web had been configured with:

"OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp"

And the nginx configuration generated with
OMERO.server/bin/omero web config nginx --http "$WEBPORT" > OMERO.server/etc/nginx/omero-nginx.conf

When I try to run nginx with the following command:
/usr/sbin/nginx -c /opt/omero/OMERO.server/etc/nginx/conf/omero-nginx.conf

I get the error:
nginx: [emerg] "upstream" directive is not allowed here in /opt/omero/OMERO.server/etc/nginx/conf/omero-nginx.conf:1

contents of omero-nginx.conf:

upstream omeroweb {
server 127.0.0.1:4080 fail_timeout=0;
}

server {
listen 8881;
server_name $hostname;

sendfile on;
client_max_body_size 0;

# maintenance page serve from here
location @maintenance {
root /opt/omero/OMERO.server/etc/templates/error;
try_files $uri /maintainance.html =502;
}

# weblitz django apps serve media from here
location /static {
alias /opt/omero/OMERO.server/lib/python/omeroweb/static;
}

location @proxy_to_app {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_buffering off;

proxy_pass http://omeroweb;
}

location / {

error_page 502 @maintenance;
# checks for static file, if not found proxy to app
try_files $uri @proxy_to_app;
}

}
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm

Re: Getting "upstream directive is not allowed here " error

Postby wmoore » Tue Apr 23, 2019 9:46 am

When running nginx, passing the config with -c as described https://docs.openmicroscopy.org/omero/5 ... using-wsgi you'll need to use the developer config generated via

Code: Select all
$ bin/omero web config nginx-development


To run in production, see https://docs.openmicroscopy.org/omero/5 ... ring-nginx

Hope that helps,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Getting "upstream directive is not allowed here " error

Postby tinat » Tue Apr 23, 2019 4:56 pm

Hi Will,

Thanks! That worked!
Best, Tina
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm


Return to Installation and Deployment

Who is online

Users browsing this forum: Google [Bot] and 1 guest