nginx的小总结(二)
nginx的小总结(二)
nginx的小总结(二)
nginx的小总结(一)
http://www.2cto.com/os/201302/191860.html
配置文件比较多,下面列出一些
www.2cto.com
[root@host2 nginx]# cat conf/nginx.conf | grep \# -v
#user nobody;
user nginx nginx; //用户,这条是自己加的,因为被注释掉了
worker_processes 1;
events {
worker_connections 1024;
use epoll; //使用的i/o模型
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80; //监听的端口
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
可以看到的是,nginx的配置文档,是分区域的!
以上给出的即是nginx基础的配置,关于更详细的配置,请访问wiki.nginx.org
评论暂时关闭