alibaba/nginx-http-concat

求助,试用了这个模块合并后的请求,浏览器一直返回400错误,文件类型是一样的,都是js,具体设置如下:

elover opened this issue · 3 comments

nginx 的版本:
mactekiMacBook-Pro-3:~ mac$ nginx -V
nginx version: nginx/1.5.7
built by clang 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --http-proxy-temp-path=/var/nginx/proxy --http-fastcgi-temp-path=/var/nginx/fastcgi --http-client-body-temp-path=/var/nginx/client --add-module=nginx-http-concat

nginx.conf设置:
location /sea-modules/ {
concat on;
concat_max_files 20;
}
文件目录就是html-->index+sea-modules

浏览器报错提示:
Request URL:http://localhost/sea-modules/arale/??class/1.1.0/class.js,events/1.1.0/events.js
Request Method:GET
Status Code:400 Bad Request

紧急求助,还望各位大牛能帮我解答一下

响应的content-type是什么?可能需要配置一下_concat_types_

On 2013/12/19 9:57, elover wrote:

nginx 的版本:
mactekiMacBook-Pro-3:~ mac$ nginx -V
nginx version: nginx/1.5.7
built by clang 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www
--with-http_ssl_module --with-http_sub_module --with-http_dav_module
--with-http_flv_module --with-http_gzip_static_module
--with-http_stub_status_module --http-proxy-temp-path=/var/nginx/proxy
--http-fastcgi-temp-path=/var/nginx/fastcgi
--http-client-body-temp-path=/var/nginx/client
--add-module=nginx-http-concat

nginx.conf设置:
location /sea-modules/ {
concat on;
concat_max_files 20;
}
文件目录就是html-->index+sea-modules

浏览器报错提示:
Request
URL:http://localhost/sea-modules/arale/??class/1.1.0/class.js,events/1.1.0/events.js
Request Method:GET
Status Code:400 Bad Request

紧急求助,还望各位大牛能帮我解答一下


Reply to this email directly or view it on GitHub
#16.

Thanks
-YWB

I have same problem with js files too

curl -I http://ghost.centminmod.com/assets/js/??slimbox2.js,highlight.js
HTTP/1.1 400 Bad Request
Server: nginx centminmod
Date: Thu, 19 Dec 2013 05:59:10 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive

did try using

concat_types text/css text/html application/javascript;

but did not work still get 400 bad requests

But no problems with css files

curl -I http://ghost.centminmod.com/assets/css/??screen.css,normalize.css,purecasper.css,ss.css,kb.css,sb.css
HTTP/1.1 200 OK
Server: nginx centminmod
Date: Thu, 19 Dec 2013 05:59:43 GMT
Content-Type: text/css
Connection: keep-alive
Last-Modified: Wed, 18 Dec 2013 05:20:24 GMT
Vary: Accept-Encoding
Expires: Sat, 18 Jan 2014 04:13:59 GMT
Cache-Control: max-age=2592000
Pragma: public
Cache-Control: public, must-revalidate, proxy-revalidate
Content-Encoding: gzip
Extended-Cache: 1
X-PCache-Status: HIT

Nginx configuration on CentOS 6.4 64bit KVM based VPS

nginx version: nginx/1.5.7
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) 
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/sbin --conf-path=/usr/local/nginx/conf/nginx.conf --add-module=../ngx_pagespeed-release-1.6.29.5-beta --with-http_spdy_module --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module --with-http_secure_link_module --with-http_flv_module --with-http_realip_module --with-libatomic --with-pcre=../pcre-8.33 --with-pcre-jit --with-http_dav_module --add-module=../nginx-dav-ext-module-0.0.2 --add-module=../ngx-fancyindex-ngx-fancyindex --add-module=../ngx_cache_purge-2.1 --add-module=../nginx-accesskey-2.0.3 --with-openssl=../openssl-1.0.1e --add-module=../nginx-http-concat-master --with-openssl-opt=enable-tlsext

vhost

   location /assets/css/ {
    root /home/nginx/domains/ghost.centminmod.com/ghost/content/themes/casper;
   concat on;
   concat_max_files 20;
   add_header Pragma public;
   add_header Cache-Control "public, must-revalidate, proxy-revalidate";
   access_log off;
   expires 30d;
   }

   location /assets/js/ {
    root /home/nginx/domains/ghost.centminmod.com/ghost/content/themes/casper;
   concat on;
   #concat_types text/css text/html application/javascript;
   concat_max_files 20;
   add_header Pragma public;
   add_header Cache-Control "public, must-revalidate, proxy-revalidate";
   access_log off;
   expires 30d;
   }

非常感谢哈,设置一下concat_types为application/javascript;就可以了,thank you!