Unable to open nginx with domain and can't open checkmk in Firefox browser

So I’m unable to open nginx with my domain name, arborhub.io and I can’t open checkmk on the browser either.

I decided to try & run checkmk behind nginx instead of apache, which I did successfully. I was hoping to fix the issue of the conflict between apache (checkmk) and nginx.

But I still can’t open either programs in my Firefox browser. I initially assumed my Django was causing this 502 gateway page error, but my Django server is running fine with python manaage.py runserver.

My nginx server is running fine with no errors with `sudo systemctl reload nginx’

Here is nginx status below

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: en>
     Active: active (running) since Wed 2025-04-09 20:03:09 MDT; 3h 49min ago
 Invocation: 5e827ca7649a43b8bd078f49a64d7c77
       Docs: man:nginx(8)
    Process: 10356 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>
    Process: 10360 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (>
    Process: 15562 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; >
   Main PID: 10361 (nginx)
      Tasks: 5 (limit: 18232)
     Memory: 4.4M (peak: 8.4M)
        CPU: 85ms
     CGroup: /system.slice/nginx.service
             ├─10361 "nginx: master process /usr/sbin/nginx -g daemon on; maste>
             ├─15563 "nginx: worker process"
             ├─15565 "nginx: worker process"
             ├─15566 "nginx: worker process"
             └─15567 "nginx: worker process"

Apr 09 20:03:09 corey-james-HP-Laptop-14-dq0xxx systemd[1]: Starting nginx.serv>
Apr 09 20:03:09 corey-james-HP-Laptop-14-dq0xxx systemd[1]: Started nginx.servi>
Apr 09 23:52:07 corey-james-HP-Laptop-14-dq0xxx systemd[1]: Reloading nginx.ser>
Apr 09 23:5

I’m even able to run checkmk with no errors with sudo omd start arborhub

Temporary filesystem already mounted
Starting agent-receiver...Already running.
Starting mkeventd...Already running.
Starting rrdcached...Already running.
npcd already started...
Starting nagios...Already running.
Starting apache...(already running: 6839)...OK
Starting redis...Already running.
Initializing Crontab...OK

And I checked the status of arborhub via checkmk

Doing 'status' on site arborhub:
agent-receiver: running
mkeventd:       running
rrdcached:      running
npcd:           running
nagios:         running
apache:         running
redis:          running
crontab:        running
-----------------------
Overall state:  running

Finally here is my nginx.conf (arborhub.conf) file. PS I edited out my IPv4 address for security purposes.

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

    sendfile on;
    keepalive_timeout 65;

    # Upstream configuration
    upstream myapp1 {
        ip_hash;
        server srv1.arborhub.io;
        server srv2.arborhub.io;
        server srv3.arborhub.io;
    }

    # Server configuration
    server {
        listen 80;
        server_name arborhub.io;
location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_cache video_cache;
            proxy_cache_revalidate on;
            proxy_cache_background_update on;
            proxy_cache_use_stale updating;
            proxy_cache_lock on;
            proxy_cache_valid 200 7d;
        }

        # Static files
        location /static/ {
            autoindex on;
            alias /home/ubuntu/MyProject/static/;
        }

        # Media files
        location /media/ {
            autoindex on;
            alias /home/ubuntu/MyProject/media/;
}

        # Analytics
        location /analytics {
            rewrite /analytics/(.*) /$1 break;
            proxy_pass http://192.168.1.123:30845;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $host;
            proxy_connect_timeout 36000;
        }
    }

    server {
        server_name tcno.co;

        location /arborhub {
}
    }

    server {
        server_name tcno.co;

        location /arborhub {
            proxy_pass http://192.168.1.253:5000;
            proxy_set_header Host $host;
            proxy_http_version 1.1;
            proxy_set_header Connection "";
            proxy_cache_bypass $http_upgrade;
            proxy_read_timeout 120s;
        }

        listen 80;
        listen [::]:80;
}

There should be no reason why I can’t open both checkmk and nginx with arborhub. I even configured all DNS A & AAAA records to my domain name via BIND9.

I’m pretty sure I configured everything in nginx correctly. I’m also on Ubuntu Desktop 24.04. I

Please I need help, this should be an easy fix.

From your posting, it is not clear how your server is connected to a network, nor where is the browser from which you are “unable to open nginx”. However, I checked the public DNS from two angles…

% dig +short a arborhub.io @74.82.42.42
%

$ dig +short a arborhub.io @1.0.0.1
$

…and I did not find a related IP address for “arborhub.io”.

So what should I do to fix this? Also not able to open checkmk on the browser.

I’m trying to open my domain name/checkmk via my linux server. I can’t open nginx via my domain name/checkmk since both are running on nginx.

Is there are additional files you’d like to see or any further information that would be helpful?

Would you like to view my BIND DNS server files?

Are you intending this “arborhub.io” system to be accessed by public users connecting via the global Internet? If so, you will want to register that domain with a Domain Registrar on the global Internet (perhaps Namecheap.com). My little test showed that no network host with the name “arborhub.io” is presently known to the global DNS.

Merely configuring “bind” on your own nameserver system cannot, in itself, cause the domain to be registered with the global Domain Name Service.

If you have somehow purchased the domain name “arborhub.io”, you’ll have an easier time just using an outside DNS service, rather than trying to roll your own.

So BIND is just for testing private network then? And yes, I’m intending my website, arborhub, to be accessed through global internet, e.g. end-users will be able to access it.

I used Godaddy as my domain registrar. Does this mean I have to create nameservers and A records via Godaddy, to publicly point users to my Django app? Is this what you’re suggesting?

Also that doesn’t explain why I can’t open checkmk with my IP address/website name.

Since you registered the domain via GoDaddy, the easiest path would be to use GoDaddy’s nameservers, creating A records by whatever means GoDaddy provides. Yes, there exist other ways to get nameservice, but they introduce complications.

Since I do not have experience with the “checkmk” tool, I am inclined to stand down from answering further questions involving it.

1 Like

Thank you.

One last thing, how does my nginx.conf file look? I renamed it back its original

Without knowing more details of how other parts of your setup are connected and configured, I cannot give a useful judgment about your file.

Basically, I want to know if IPv4 and IPv6 addresses should go inside this file for production purposes for my domain.

I also wanted to know if this is the proper way to add load balancers

it would probably help if you shared all of your nginx config files, what you shared earlier is just the http context and with just that nginx will not start properly. Also, since you have multiple server blocks, if you try to access it just via the IP address it will only load the one set as defaut(ie one that has default_server set on the listen directive), or it will use the first server block in the config. Other than that, the configuration looks like it should be fine, but it is hard to tell without more information about how it behaves when you try to access the different locations.

The only issue I can see is that based on the status output you posted, apache is running so that will cause issues if both nginx and apache are trying to bind to the same ports(ie 80/443).

Okay I will post my edited nginx.conf file in my OP. Regarding any other relevant nginx files, please let me know which ones you would like to see

revised nginx.conf file

  GNU nano 8.1                       nginx.conf                                 
worker_processes auto;

events {
    worker_connections 1024;
}

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

    sendfile on;
    keepalive_timeout 65;

    # Upstream load balancer configuration
    upstream myapp1 {
        ip_hash;
        server srv1.arborhub.io;
        server srv2.arborhub.io;
        server srv3.arborhub.io;
    }
    # Server block must be inside HTTP, not at the top level
    server {
        listen 80;
        listen [::]:80;
        server_name arborhub.io;

        location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_cache video_cache;
            proxy_cache_revalidate on;
            proxy_cache_background_update on;
            proxy_cache_use_stale updating;
            proxy_cache_lock on;
            proxy_cache_valid 200 7d;
        }

        location /static/ {
            autoindex on;
            alias /home/ubuntu/MyProject/static/;
        }

        location /media/ {
            autoindex on;
            alias /home/ubuntu/MyProject/media/;
        }

        location /analytics {
            rewrite /analytics/(.*) /$1 break;
            proxy_pass http://192.168.1.253:30845;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $host;
            proxy_connect_timeout 36000;
        }
    }

    server {
        listen 80;
        listen [::]:80;
        server_name tcno.co;

        location /arborhub {
            proxy_pass http://192.168.1.253:5000;
            proxy_set_header Host $host;
            proxy_http_version 1.1;
            proxy_set_header Connection "";
            proxy_cache_bypass $http_upgrade;
            proxy_read_timeout 120s;
        }
    }
}

Also I’m not running on apache, I’m running nginx as a web server, and I configured DNS A records to point to both my IPv4/arborhub domain via Godaddy

The apache comment was based on the out status output you posted originally, but assuming that service was disable you should be fine.

The configuration looks OK to me, are you still seeing any unexpected behavior? You may want to edit the listen directive for the primary server to include ‘default_server’ to assist with testing by IP address.

Can you clarify what you mean by default_server?

The development for my project is finished, but I’m not gonna deploy to production as my new cheap computer hardware is failing.

I found a refurbished Dell through System Liquidation with 32 GB RAM 1 TB 16 intel Core i7 for low price.

I think I’m gonna get it. I want my website to be in a stable system environment. But back to you your question, I decided to switch to Prometheus since it doesn’t rely on Apache.

So I uninstall checkmk and removed the checkmk configuration from nginx.conf. I’m still getting a Unable to Connect page for nginx in the browser.

No my original issue isn’t resolved

default_server is a flag in the listen directive that defines which server block should be used if there is a request to the server that either doesn’t include a DNS hostname or has a hostname that is not defined in the config. Basically it will force it to use that server if a request comes via the IP address vs a DNS name.

It seems like the core issue that still needs to be resolved is you are trying to use a domain that you have not registered(arborhub.io looks to still be parked by godaddy), so purchasing that domain and getting DNS setup still needs to be done.

To test the NGINX config, you can connect directly to the servers IP address to make sure that part is working as expected. Can you connect directly to the IP address via a web browser?