John Davis
John Davis

Reputation: 172

Nginx don't work with sites-avaliable

Here is my config: nginx.conf

user  www-data;
worker_processes  2;

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

events {
    worker_connections  1024;
        use epoll;
}


http {
        client_max_body_size 15m;
        server_names_hash_bucket_size 64;
        postpone_output 1460;
        sendfile_max_chunk 128k;
        sendfile on;
        fastcgi_cache_path /tmp/fcgi-cache/ levels=1:2   keys_zone=one:10m;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
        server_tokens off;
    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;
        error_log /var/log/nginx/error.log;

    tcp_nopush     on;

    keepalive_timeout  65;

    gzip  on;
        ssi on;

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

here is my domain.com config in sites-available:

server {

root /var/www/domain.com/;

access_log /var/log/nginx/default-access.log;
error_log /var/log/nginx/default-error.log;

include /etc/nginx/templates/default;
include /etc/nginx/templates/php;
include /etc/nginx/templates/phpmyadmin;

}

When i enter a url domain.com it shows default nginx page. When i comment include /etc/nginx/conf.d/*.conf; i can't even load nginx page, it lools like server is not even working. I've written my site in sites-available and made a ln -s to sites-enabled. What is wrong?

Upvotes: 0

Views: 779

Answers (1)

Maydex
Maydex

Reputation: 101

You have to put server_name domain.com; in server block :)

Upvotes: 1

Related Questions