这是我的配置: 的 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/*;
}
这是我在site.com中的domain.com配置:
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;
}
当我输入url domain.com时,它会显示默认的nginx页面。当我评论包括/etc/nginx/conf.d/*.conf;我甚至无法加载nginx页面,它像服务器一样甚至不工作。我已经在站点中编写了我的站点 - 并且已经启用了站点ln -s。 有什么问题?
答案 0 :(得分:1)
你必须把server_name domain.com;在服务器块中:)