zoukankan      html  css  js  c++  java
  • windows 下 nginx 配置文件路径[转自网络]

    nginx在windowns下路径

    http{
     #虚拟主机1
     server{
      listen       80;   #监听端口,基于IP配置的时候变更此处,比如192.168.1.100:8080;
      server_name  www.xdw.com;  #主机域名,实际项目发布的话,填公网上的域名,本地部署的话,可以在C:WindowsSystem32driversetchosts文件中添加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压缩输出
  • 相关阅读:
    IO操作之BIO、NIO、AIO
    IO之Socket网络编程
    this.getClass()和super.getClass()得到的是同一个类
    经济增长的背后
    SVN分支创建与合并
    .net类库里ListView的一个BUG
    VS2010调试技巧
    用C#代码编写的SN快速输入工具
    请教如何改善C#中socket通信机客户端程序的健壮性
    利用WebClient实现对Http协议的Post和Get对网站进行模拟登陆和浏览
  • 原文地址:https://www.cnblogs.com/awei4home/p/9297250.html
Copyright © 2011-2022 走看看