zoukankan      html  css  js  c++  java
  • nginx笔记

    1、直接返回来访IP

    location /ip {

      default_type text/plain;

      return 200 $remote_addr;

    }

    2、流转发及写日志、开启websocket:

          log_format  stream  '$remote_addr ($remote_user) $time_local' ;

            map $http_upgrade $connection_upgrade {
                    default upgrade;
                    ''      close;
            }
            map $uri $log_stream_user {
                    default 0;
                    "~SND" 1;
            }

    stream {
        server {
            listen 15678;
            proxy_pass 192.168.1.99:1234;
        }
            server {
                            listen 8073;
                            access_log /var/log/nginx/access_8073.log stream buffer=1k flush=5s if=$log_stream_user;
                            location / {
                                            proxy_pass http://192.168.1.1:8073;
                                            proxy_http_version 1.1;
                                            proxy_set_header Upgrade $http_upgrade;
                                            proxy_set_header Connection "upgrade";
                                            auth_basic "Wellcome to visit ......";
                                            auth_basic_user_file htpasswd;
                            }
                            location ^~ /admin {
                                            deny all;
                            }
            }

    }


  • 相关阅读:
    polya定理
    树状数组
    离散数学通路数的矩阵计算法
    高次同余方程求解
    Uva1378
    poj2888
    poj2409&&poj1286
    poj2182
    poj2154
    判断一个字符是否为汉字
  • 原文地址:https://www.cnblogs.com/d9394/p/12033947.html
Copyright © 2011-2022 走看看