已经解决,自己从官网tegine重新下载后把http_concat_module模块给替换掉,重新编译后就OK了。但是出现了个新问题,合并CSS和JS都会出现加载失败,原因是response headers里的content type都变成了text/html。 尝试了nginx各种设置,但是还是不行,求大神帮忙!
nginx.conf
- user www www;
- worker_processes auto;
- error_log /www/wwwlogs/nginx_error.log crit;
- pid /www/server/nginx/logs/nginx.pid;
- worker_rlimit_nofile 65535;
- events
- {
- use epoll;
- worker_connections 65535;
- accept_mutex on;
- multi_accept on;
- }
- http
- {
- default_type application/octet-stream;
- include /www/server/nginx/conf/mime.types;
- #include luawaf.conf;
- include proxy.conf;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- log_format logstash_json '{"@timestamp":"$time_iso8601",'
- '"host":"$server_addr",'
- '"clientip":"$remote_addr",'
- '"size":$body_bytes_sent,'
- '"responsetime":$request_time,'
- '"upstreamtime":"$upstream_response_time",'
- '"upstreamhost":"$upstream_addr",'
- '"http_host":"$host",'
- '"url":"$uri",'
- '"domain":"$host",'
- '"xff":"$http_x_forwarded_for",'
- '"referer":"$http_referer",'
- '"agent":"$http_user_agent",'
- '"status":"$status"}';
- server_names_hash_bucket_size 512;
- client_header_buffer_size 32k;
- large_client_header_buffers 4 32k;
- client_max_body_size 10m;
- sendfile on;
- tcp_nopush on;
- keepalive_timeout 65 60;
- tcp_nodelay on;
- fastcgi_connect_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_read_timeout 300;
- fastcgi_buffer_size 64k;
- fastcgi_buffers 4 64k;
- fastcgi_busy_buffers_size 128k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_intercept_errors on;
- gzip on;
- gzip_min_length 1k;
- gzip_buffers 4 16k;
- gzip_http_version 1.1;
- gzip_comp_level 2;
- gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
- gzip_vary on;
- gzip_proxied expired no-cache no-store private auth;
- gzip_disable "MSIE [1-6]\.";
- limit_conn_zone $binary_remote_addr zone=perip:10m;
- limit_conn_zone $server_name zone=perserver:10m;
- server_tokens off;
- access_log off;
- server
- {
- listen 888;
- server_name phpMyAdmin;
- index index.html index.htm index.php;
- root /www/server/phpMyAdmin;
- #error_page 404 /404.html;
- include enable-php.conf;
-
- location / {
- root html;
- index index.html index.htm;
- proxy_connect_timeout 60;
- proxy_send_timeout 60;
- proxy_read_timeout 60;
- }
-
- location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
- {
- expires 30d;
- }
- location ~ .*\.(js|css)?$
- {
- expires 12h;
- }
- location ~ \.css {
- concat on;
- concat_max_files 20;
- concat_ignore_file_error on;
- add_header Content-Type text/css;
- }
- location ~ \.js {
- concat on;
- concat_max_files 30;
- concat_ignore_file_error on;
- add_header Content-Type application/x-javascript;
- }
- location ~ /\.
- {
- deny all;
- }
- location ~* \.php$ {
- root /usr/share/nginx/html;
- index index.html index.htm index.php;
- fastcgi_split_path_info ^(.+\.php)(/.+)$; #this line
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME
- $document_root$fastcgi_script_name; # update this too
- include fastcgi_params;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- access_log /www/wwwlogs/access.log;
- }
- include /www/server/panel/vhost/nginx/*.conf;
- }
复制代码
|