zoukankan      html  css  js  c++  java
  • nginx配置相关

    一、autoindex on; 能解决无端端的403问题。

    二、NGINX配置超时时间

    1、啥时候用到

        用来设置请求资源和服务器返回的时间,保证一个请求占用固定时间,超出后报504超时!这样可以保证一个请求占用过长时间。

    2、主要参数

        使用nginx服务器如果遇到timeou情况时可以如下设置参数,使用fastcgi:

        fastcgi_connect_timeout 75;  链接

        fastcgi_read_timeout 600;   读取

        fastcgi_send_timeout 600;   发请求

        这两个选项.
        fastcgi_read_timeout是指fastcgi进程向nginx进程发送response的整个过程的超时时间
        fastcgi_send_timeout是指nginx进程向fastcgi进程发送request的整个过程的超时时间

        这两个选项默认都是秒(s),可以手动指定为分钟(m),小时(h)等

    三、网站根域名默认指向www配置

     if ($http_host !~ "^www.xxx.com$") {
    
                           rewrite  ^(.*)    http://www.xxx.com$1 permanent;
    
                     }

    根据get参数动态指向不同目录

    server {
            listen       80;
            server_name  mb-dev.api.11yuehui.com;
            index index.php index.html;
            autoindex on;
            include enable-php.conf;
    
            set $branche "branche";
    
            if ($query_string ~ "_APPVERSION=(.*)") {
                set  $branche  $1;
            }
    
            root /opt/htdocs/haluo/$branche/public;
    
            include thinkphp.conf;
            access_log  /home/wwwlogs/mb_access.log;
    }
    
    //thinkphp.conf
    
    location / {
            
            
        if (!-e $request_filename) {
            rewrite ^(.*)$ index.php?s=/$1 last;
            break;
        }    
    } 
    

      

     2018-08-14

    php的运行监听不要用socket方式,要用端口的方式,不然会报以下错误

    PHP message: PHP Fatal error:  Too many concurrent users, try again in 1 seconds.
    

      

    暗夜之中,才见繁星;危机之下,暗藏转机;事在人为,为者常成。
  • 相关阅读:
    offsetLeft,Left,clientLeft的区别
    IIS 内部运行机制
    常用正则表达式
    千万不要把 bool 设计成函数参数
    ASP.NET第一课,IIS安装与配置
    将字符串转为变量名(C#)
    淘宝技术发展
    C# 反射机制
    技术普及帖:你刚才在淘宝上买了一件东西
    高性能分布式计算与存储系统设计概要——暨2012年工作3年半总结
  • 原文地址:https://www.cnblogs.com/zenghansen/p/4002831.html
Copyright © 2011-2022 走看看