zoukankan      html  css  js  c++  java
  • nginx.conf文件说明

    #Nginx所有用户和组,window下不指定
    #user  nobody;
    
    #工作的子进程数量(通常等于CPU数量或者2倍于CPU)
    worker_processes  1;
    
    #错误日志存放路径
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #指定pid(进程id)存放文件
    #pid        logs/nginx.pid;
    
    
    #执行的事件
    events {
        #允许最大连接数
        worker_connections  51200;
    }
    
    
    http {
        # MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型
        include       mime.types;
        #默认类型——八字节数据流
        default_type  application/octet-stream;
    
        #定义日志格式
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #生成日志
        #access_log  logs/access.log  main;
    
        #发送文件
        sendfile        on;
        #打开tcp通道
        #tcp_nopush     on;
    
        #活动时间
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        #打开gzip数据流压缩
        #gzip  on;
    
        #对于服务的配置
        server {
            #端口号(如果你本地安装了其他Web服务器,为了避免冲突,这里需要修改)
            listen       80;
            #服务名,本地或者www.abc.com *.abc.com
            server_name  localhost;
            #设置字符集
            #charset koi8-r;
            #打日志
            #access_log  logs/host.access.log  main; 
    
            location / {
                root   html;
                index  index.html index.htm;
            }
    
            #错误页定义
            error_page  404              /404.html;
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ .php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            #location ~ .php$ {
            #    root           html;
            #    fastcgi_pass   127.0.0.1:9000;
            #    fastcgi_index  index.php;
            #    fastcgi_param  SCRIPT_FILENAME /scripts$fastcgi_script_name;
            #    include        fastcgi_params;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /.ht {
            #    deny  all;
            #}
        }
        # another virtual host using mix of IP-, name-, and port-based configuration
        #
        #server {
        #    listen       8000;
        #    listen       somename:8080;
        #    server_name  somename  alias  another.alias;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    
    
        # HTTPS server
        #
        #server {
        #    listen       443;
        #    server_name  localhost;
        #    ssl                  on;
        #    ssl_certificate      cert.pem;
        #    ssl_certificate_key  cert.key;
    
        #    ssl_session_timeout  5m;
    
        #    ssl_protocols  SSLv2 SSLv3 TLSv1;
        #    ssl_ciphers  HIGH:!aNULL:!MD5;
        #    ssl_prefer_server_ciphers   on;
    
        #    location / {
        #        root   html;
        #        index  index.html index.htm;
        #    }
        #}
    }
  • 相关阅读:
    重置 Mac 上的 NVRAM 或 PRAM
    为什么我的mac插入耳机耳机没有声音呢?
    Redis 实现安全队列
    设计模式之十三:适配器模式(Adapter)
    关于cocos2dx手游lua文件加密的解决方式
    Django中载入js和css文件
    CCNA 例题精选
    JNI/NDK开发指南(四)——字符串处理
    error when loading the sdk 发现了元素 d:skin 开头无效内容
    Webx学习(一)
  • 原文地址:https://www.cnblogs.com/linjiqin/p/5489068.html
Copyright © 2011-2022 走看看