zoukankan      html  css  js  c++  java
  • nginx虚拟机的配置

    user nginx nginx;
    worker_processes 1;
    pid /data/var/run/nginx/nginx.pid;
    worker_rlimit_nofile 51200;

    events
    {
    #epoll是多路复用IO中的一种方式
    use epoll;
    #单个后台的work process进行的最大并发链接数
    worker_connections 51200;
    }

    http{
    #设定mime类型,类型由mime.types文件定义
    include mime.types;
    default_type application/octet-stream;
    #设置日志格式

    #指定nginx是否调用sendfile来输出文件
    sendfile on;

    #连接超时时间
    keepalive_timeout 60;
    tcp_nodelay on;
    #声明日志格式,请求的地址,状态,请求ip
    log_format access '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" $http_x_forwarded_for';

    #设置虚拟主机设置
    server{
    #侦听80端口
    listen 80;
    #定义访问域名
    server_name lx.workplace.com;
    #定义服务器的默认网站根目录位置
    root /data/wwwroot/workplace;
    #默认请求
    location / {
    #定义首页索引文件名称
    index index.php index.html index.htm;
    }

    #设置php脚本请求全部转发到fastcgi处理
    location ~ .php$ {
    #fastcgi端口
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    #fastcgi路径
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }
    #设置日志
    access_log /data/wwwlogs/admin.njw88.com/access.log;
    error_log /data/wwwlogs/admin.njw88.com/error.log;
    }
    }

  • 相关阅读:
    最小的k个数
    复杂链表的复制
    二叉树中和为某一值的路径
    二叉搜索树的后序遍历序列
    STL之Deque容器
    STL之迭代器
    STL之Vector容器
    STL之string
    STL(标准模板库)基本概念
    文件I/O
  • 原文地址:https://www.cnblogs.com/lisqiong/p/5524668.html
Copyright © 2011-2022 走看看