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;
    }
    }

  • 相关阅读:
    习惯的本质:逐步建立新的常态
    如何度过有用的每一天
    如何利用晚上八点到十点这段时间自我提升
    为什么很多年轻人总会感到迷茫
    当你学会专注,人生才算真正成熟
    如何过上简单的生活
    游标
    触发器

    函数
  • 原文地址:https://www.cnblogs.com/lisqiong/p/5524668.html
Copyright © 2011-2022 走看看