Welcome! Log In Create A New Profile

Advanced

Can't get DNS working

Posted by diamondf 
Can't get DNS working
February 23, 2011 03:51PM
Hey guys, I'm having problems. I'm a little new to nginx, and I've set it up on my server. I redirected my domains to it, and I'm getting a "Server not found"

The site *does* work when I just enter in the IP, since I have the default server set up with a localhost that goes to /home/mainsite/public_html/

So when I go to: http://100.100.100.100/folder/file.php, everything works.

However, the nameserver I'm using is supposed to be going to a different folder than /home/mainsite/public_html/. It needs to go to /home/gamesite/public_html/

This is my /etc/nginx/sites-enabled/default:
server {
listen 80 default;
server_name localhost;

access_log /var/log/nginx/localhost.access.log;

location / {
root /home/mainsite/public_html;
index index.php index.html;
}

# MORE BELOW
}

This is my /etc/nginx/sites-enabled/gamesite:
server {

listen 80; ## listen for ipv4

server_name *.gamesite.com;

access_log /var/log/nginx/flariusgames.com.access.log;
error_log /var/log/nginx/flariusgames.com.error.log;

location / {
root /home/gamesite/public_html/;
index index.php index.html;
}

# MOREBELOW
}

I've changed the server name to gamesite.com, but no matter what, I run into problems. Another strange thing is that when I go to http://gamesite.com, it loads up www.gamesite.com, so I don't know if this is a DNS issure or something. And if it is, I don't really know how to do that...

Can someone please help?
Re: Can't get DNS working
February 23, 2011 04:00PM
Okay, I'm really confused now. I just changed default to point to a nonsense directory, and restarted nginx, and nothing changed at all....

server {
listen 80 default;
server_name *.nonsense.com;

access_log /var/log/nginx/localhost.access.log;

location / {
root /home/pointless/directory;
index index.php index.html;
}
}

And yet the directories that I previously set up are still working perfectly normal after a successful restart of nginx. How is that file being ignored? And/or why? What am I missing here? Isn't the whole point of those files to direct to the directories I have? That was how I got things working in the first place... I'm so lost...

Edit: Wait, nevermind.. it cached it or something. Now it seems to broken, as I was expecting it to be.



Edited 1 time(s). Last edit at 02/23/2011 04:03PM by diamondf.
Re: Can't get DNS working
February 23, 2011 04:16PM
New update... I modified the default file so that it connected to "_" (the "catch all" one) and the DNS still will not connect. So I'm assuming this isn't an nginx configuration issue, correct? Because if it were, the DNS wouldn't be hitting a server not found?

If someone could help me with this regardless, it would be appreciated.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready