404 error on nginx and centos 7

Hello, I am installing a centos 7 testing machine with omero. I managed to solve some issues with postgres and the instalation of both omero and omero-web are working.
Nginx is working fine on localhost but when I try to access http://localhost/omero I receive a 404 response. I have followed the instructions twice, reinstalling nginx without success. Could I have some help? I believe the problem could be nginx.conf or omero-web.conf so I am adding them to the topic.
Thanks
nginx-config.zip (1.6 KB) nginx-log.zip (960 Bytes) omero-log.zip (19.7 KB)

In nginx.conf, you have a default server on port 80:

http {
    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;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80; # default_server;
        listen       [::]:80; # default_server;
        server_name  _;

This overrides the one in omero-web.conf:

http {
    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;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80; # default_server;
        listen       [::]:80; # default_server;
        server_name  _;

Try removing the line:
…removed since incorrect…
and everything after it in nginx.conf.

Edit: see below. Only remove the server {} section from nginx.conf.

Cheers,
~Josh

I am afraid it didn’t work as now i get an error loading nginx.conf. The trobleshooting page mentions something about default configuration for location being loaded prior to omero-web.conf but there are no explanations on how to solve the issue

Update. I removed the nginx.conf configuration for the server and left like
server {
}

I also ran again the following commands to generate an new omero-web.conf
MERO.server/bin/omero web config nginx --http “$WEBPORT” > OMERO.server/nginx.conf.tmp
cp OMERO.server/nginx.conf.tmp /etc/nginx/conf.d/omero-web.conf

This solved the problem
Thanks

Sorry for the troubles, @Joao_Miguel. That’s what I get for making suggestions before going to bed! Glad to hear that things are working again. I’ve updated my previous post so no one tries it by accident.

All the best,
~Josh

You may have typed the wrong entry but had the right approach and guided me to find the solution. It was a looong night reading post all over the Internet but reminded me why I used to love Linux :grin:. Everyone helps with solutions! Next challenge will be to secure the server, so I might be back​:flushed:…