zoukankan      html  css  js  c++  java
  • nginx concat模块配置 页面返回400 bad request

    在1.4.x版本的nginx没有发现这个问题,但是在1.5.x版本就遇到了这个问题

    由于Nginx在新版本中,使用了标准的 MIME-Type:application/javascript。而在nginx_concat_module模块目前版本的代码中,写的是 application/x-javascript 的类型。

    在nginx-http-concat-master 找到,14行

    static ngx_str_t  ngx_http_concat_default_types[] = {
        ngx_string("application/x-javascript"),
        ngx_string("text/css"),
        ngx_null_string
    };

    在上述代码中加入 ngx_string("application/javascript"),或者直接把 ngx_string("application/x-javascript")改为ngx_string("application/javascript")上代码

    #修改
    static ngx_str_t  ngx_http_concat_default_types[] = {
        ngx_string("application/javascript"),
        ngx_string("text/css"),
        ngx_null_string
    };
    #或者
    #新加
    static ngx_str_t  ngx_http_concat_default_types[] = {
        ngx_string("application/x-javascript"),
        ngx_string("application/javascript"),
        ngx_string("text/css"),
        ngx_null_string
    };

    然后就ok了

  • 相关阅读:
    HDU 5794
    HDU 5794
    3070 Fibonacci 矩阵快速幂
    数论基础
    hdu 1061 Rightmost Digit 快速幂
    poj 2305 Basic remains java
    poj 1001 Exponentiation
    hdu 2054 A == B ? (java)
    java大数练习
    hdu3018 Ant Trip 欧拉回路
  • 原文地址:https://www.cnblogs.com/ppli/p/5732874.html
Copyright © 2011-2022 走看看