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了
nginx concat模块配置 页面返回400 bad request的更多相关文章
- Nginx反向代理tomcat返回400 bad request
Nginx反向代理tomcat返回400 bad request nginx 版本1.12, tomcat版本 9.06 最近用Nginx做反向代理tomcat,实现前后端分离,nginx 将请求代理 ...
- 利用nginx concat模块合并js css
前言: nginx-http-concat模块是由淘宝网开发的,现在淘宝网合并js和css正是用这个模块,如链接http://a.tbcdn.cn/??s/kissy/1.2.0/kissy-min. ...
- nginx过一段时间出现400 Bad Request 错误的解决方法
tomcat整合nginx成功后,等访问一段时间后,会出现 Bad Request (Invalid Hostname)的错误, 因为是已经成功的配置,所以判定可能是哪里的限制设置有问题,最后在官方网 ...
- Yii apache配置站点出现400 Bad Request 的解决方法
<VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot "/www/frogCms/ ...
- nginx FastCGI模块配置
这个模块允许nginx同FastCGI协同工作,并且控制哪些参数将被安全传递. location / { fastcgi_pass localhost:9000;# 或者http://ip:9000; ...
- nginx缓存模块配置总结proxy_cache(未完)
简介:此缓存设置用到了第三方模块purge,使用的时候就在源链接和访问的具体内容之间加入关键字"/purge/"即可. 如:访问http://192.168.0.1/a.png 会 ...
- nginx gzip 模块配置
#gzip模块设置 gzip on; #开启gzip压缩输出 gzip_min_length 1k; #最小压缩文件大小 gzip_buffers 4 16k; #压缩缓冲区 gzip_http_ve ...
- 5.6 Nginx Rewrite模块配置
- nginx访问fastdfs文件 报错400 Bad Request
1.修改vi /etc/fdfs/mod_fastdfs.conf 2.将url_have_group_name = false 改为 url_have_group_name = true 3.重启 ...
随机推荐
- wpf Webbrowser 乱码问题及弹窗被遮挡
wpf的webbrowser在使用NavigateToString(string text);方法时如果字符串含有中文字符,并在html的头文件中没有声明Document的编码方式为UTF-8的话,由 ...
- How to Use Android ADB Command Line Tool
Android Debug Bridge (adb) is a tool that lets you manage the state of an emulator instance or Andro ...
- Atitit.创业之uke团队规划策划 v9
Atitit.创业之uke团队规划策划 v9 Uke org prjAuthor撰写人:绰号:老哇的爪子( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努 ...
- 预处理(防止sql注入的一种方式)
<!--- 预处理(预编译) ---><?php/* 防止 sql 注入的两种方式: 1. 人为提高代码的逻辑性,使其变得更严谨,滴水不漏. 比如说 增加判断条件,增加输入过滤等,但 ...
- jQuery插件:jqGrid使用(一)
1. Loading Data Load from JavaScript Array BundleConfig.cs using System.Web; using System.Web.Optimi ...
- Newtonsoft.json中 linq to json 和序列化哪个快?
Newtonsoft.json是最常用的json序列化组件,当然他不是最快的,但是是功能最全的.. using System; using System.Collections.Generic; us ...
- Javascript算法系列之快速排序(Quicksort)
原文出自: http://www.nczonline.net/blog/2012/11/27/computer-science-in-javascript-quicksort/ https://gis ...
- GROUP BY的扩展
GROUP BY的扩展主要包括ROLLUP,CUBE,GROUPING SETS三种形式. ROLLUP rollup相对于简单的分组合计增加了小计和合计,解释起来会比较抽象,下面我们来看看具体事例. ...
- 重温JSP学习笔记--JSP动作标签
上一篇笔记写的是jsp的三个指令九个内置对象,这篇随笔开始写jsp的动作标签,动作标签是由服务器(Tomcat)来解释执行,与java代码一样,都是在服务器端执行的,jsp动作标签有十几多个,这里只写 ...
- 第三方侧滑菜单SlidingMenu在android studio中的使用
南尘:每天进步一点点! 前面讲了官方的侧滑菜单DrawerLayout的使用,其实早在官方没有推出这个之前,就有很多第三方的jar包如SlidingMenu等,感谢开源的力量. SlidingMenu ...