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压缩输出
    
  • 相关阅读:
    lodash-es 最小化引入
    shortid id生成器
    结构体声明的方式 及类namespace的前置声明
    结构体中使用 箭头 与 点 的区别
    进入Docker容器的几种方式
    协议分析处理工具ProtoBuf
    PubSub ——“发布/订阅”模式
    在Windows/linux下进行gdb调试
    C++中的域作用符::的作用
    C++ 中常用关键字及其用法
  • 原文地址:https://www.cnblogs.com/smiler/p/8716934.html
Copyright © 2011-2022 走看看