zoukankan      html  css  js  c++  java
  • 自定义header参数时的命名要求

    HTTP头是可以包含英文字母([A-Za-z])、数字([0-9])、连接号(-)hyphens, 也可义是下划线(_)。在使用nginx的时候应该避免使用包含下划线的HTTP头。主要的原因有以下2点。
    1.默认的情况下nginx引用header变量时不能使用带下划线的变量。要解决这样的问题只能单独配置underscores_in_headers on。
    2.默认的情况下会忽略掉带下划线的变量。要解决这个需要配置ignore_invalid_headers off。

    http {
        include       mime.types;
        default_type  application/octet-stream;
        log_format  main  '$http_orig_client_ip - $remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"  "$upstream_addr" ';
        sendfile        on;
        underscores_in_headers on;
        ignore_invalid_headers  off;
        keepalive_timeout  65;
     upstream test2081{
        server 10.209.128.28:2081;
    }
  • 相关阅读:
    O(n^2)的排序方法
    99乘法表
    excel 转 csv
    批量关闭 excel
    tomcat 加入服务
    文件打包 zip
    字符串转换
    List数组种删除数据
    mybatis 批量上传
    sql server 查询表字段及类型
  • 原文地址:https://www.cnblogs.com/gyfluck/p/8320294.html
Copyright © 2011-2022 走看看