【发布时间】:2015-06-02 09:09:17
【问题描述】:
我是 NGINX 的新手,我不知道我是否正确设置了我的 conf 文件。我正在尝试提供位于 data/www 目录中的 index.html 文件。我做了很多研究,我似乎无法弄清楚。我在运行 centOS 6.5 的 ec2 上安装了 nginx。任何有关如何启动和运行的指示将不胜感激。一段时间以来,我一直在努力解决这个问题。提前谢谢!
user nginx;
worker_processes 1;
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 {
listen 80;
server_name <my elastic ip address>;
location / {
root /data/www/;
index index.html;
}
}
}
【问题讨论】: