zoukankan      html  css  js  c++  java
  • nginx.conf-2

    server {
    listen 80;
    server_name 120.78.64.28;

    location / {
    limit_req zone=one ;
        root   /usr/local/nginx/html;
        index  index.html index.htm index.php;
    #if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) { rewrite ^(.*) http://www.baidu.com$1 permanent; }
    #default_type text/html;
    #return 200 $remote_addr;
    #return 200 $http_user_agent;
    }
    location /api {
    rewrite ^/api/(.*)/(.*)/(.*)/(.*)$ /api/index.php?$1=$2&$3=$4 last; 
    break;
    
    }
    location /cache {
    expires 30m;
    proxy_cache my_cache;
    
    }
    location /upstream {
    default_type text/html;
    return 200 $scheme$proxy_host$uri$is_args$args;
    proxy_cache my_cache;
    proxy_cache_valid any 1m;
    proxy_cache_key $scheme$proxy_host$uri$is_args$args;
    proxy_ignore_headers Cache-Control;
    proxy_cache_bypass 1;
    
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;	
    
    proxy_next_upstream timeout;
    proxy_next_upstream_tries 1;
    proxy_next_upstream_timeout 1;
    proxy_send_timeout 3;
    proxy_read_timeout 4;
    proxy_connect_timeout 3;
    proxy_pass http://swoole_server;
    }
    location ~* ^.+.(jpg|gif|png|swf|flv|wma|wmv|asf|mp3|mmf|zip|rar)$ {
    valid_referers 120.78.64.28  www.baidu.com;
    if ($invalid_referer) {
        return 200 $remote_addr;break;
    }
    
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/local/nginx/html;
    }
    
    location ~ .php$ {
        fastcgi_pass   120.78.64.28:9000;
    fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /www/$fastcgi_script_name;
        include        fastcgi_params;
    }
    
    location =/test {
        default_type text/html;
        return 200 'test1';
    }
    
    location /test {
        default_type text/html;
        return 200 'test2';
    }
    

    }

  • 相关阅读:
    PHP中过滤数组中的元素
    cookie中文乱码解决(php/js)
    Ubuntu系统tar克隆
    磁盘IO性能监控(Linux 和 Windows)
    远程桌面由于帐户限制你无法登录问题
    SAP中关于用户IP信息的获取
    选择界面制作按钮
    ALV常用参数详细描述
    销售订单、外向交货单、交货 bapi
    abap 常用表
  • 原文地址:https://www.cnblogs.com/xivzhou/p/14441847.html
Copyright © 2011-2022 走看看