JVG
JVG

Reputation: 21150

CentOS/Nginx server isn't working, hosting Node apps

I have a pretty simple server setup that isn't working for some reason.

I have two apps running locally, one on port 1999 and the other on port 8000.

I have disabled Apache, and have nginx installed. Here's my nginx.conf in /etc/nginx/:

user  nginx;
worker_processes  8;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include   /etc/nginx/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  65;

    gzip  on;
    server_names_hash_bucket_size 64;

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

And here's my default.conf in /etc/nginx/conf.d/ :

server {
    listen 80;

    server_name attendahh.com;

    location / {
        proxy_pass http://localhost:1999;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

server {
    listen 80;

    server_name threadfinder.net;

    location / {
        proxy_pass http://localhost:8000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Navigating to http://my-ip-address:1999 and http://my-ip-address:8000 works just fine, but going to my domains does not.

I get the feeling that NGINX just plain isn't working, and maybe something in my hosts file/something else is messing things up. Any ideas on what steps I can take to work this out? This is a fresh install of NGINX.

EDIT: Also, when I try to access threadfinder.net and attendahh.com nothing appears in my access logs at /var/log/nginx/access.log

Upvotes: 0

Views: 193

Answers (1)

user3754610
user3754610

Reputation: 11

Well, do you have problem with DNS?

Upvotes: 1

Related Questions