windows 下 nginx 配置文件路径[转自网络]

nginx在windowns下路径

http{ #虚拟主机1 server{ listen 80; #监听端口,基于IP配置的时候变动此处,好比192.168.1.100:8080; server_name www.xdw.com; #主机域名,实际项目发布的话,填公网上的域名,本地部署的话,能够在C:\Windows\System32\drivers\etc\hosts文件中添加IP和域名的映射 location / { #映射解析,/表明根路径,此处解析还有正则表达式的解析方式,具体请参考http://tengine.taobao.org/nginx_docs/cn/docs/http/ngx_http_core_module.html#location root E:/xdw/0221; #工程所在路径 index index.html index.htm; #首页(默认页) } } #虚拟主机2,能够同时配置多个虚拟主机 server{ listen 8080; server_name localhost; location / { root D:/xiangmu/txym_web; index index.html index.htm; } } } http下的一些配置及其意义 include mime.types; #文件扩展名与文件类型映射表 default_type application/octet-stream; #默认文件类型 sendfile on; #开启高效文件传输模式,sendfile指令指定nginx是否调用sendfile函数来 输出文件,对于普通应用设为 on,若是用来进行下载等应用磁盘IO重负载应用,可设置 为off,以平衡磁盘与网络I/O处理速度,下降系统的负载。注意:若是图片显示不正常 把这个改为off。 autoindex on; #开启目录列表访问,合适下载服务器,默认关闭。 tcp_nopush on; #防止网络阻塞 tcp_nodelay on; #防止网络阻塞 keepalive_timeout 120; #长链接超时时间,单位是秒 gzip on; #开启gzip压缩输出
相关文章
相关标签/搜索