1
回答
Tengine1.3 设置反向代理后js css合并功能无效。
注册华为云得mate10,2.9折抢先购!>>>   
server {
        listen       80;
        server_name  071099.com www.071099.com;#多个域名用空格隔开
if ($host != "071099.com" ){
 rewrite ^/(.*)$ http://071099.com/$1 permanent;
}
index index.html index.htm index.php;
root /alidata/www/phpwind;
location / 
{
concat on;
root /alidata/www/phpwind;
}
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪静态规则
include /alidata/server/nginx/conf/rewrite/discuz_x2.conf;
log_format  phpwind  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" "$http_x_forwarded_for"';
access_log  /alidata/log/nginx/access/phpwind.log phpwind;
}
以上配置使用js css 合并没有问题

当使用反向代理之后:js css 合并特性不能使用,何必的请求直接发到后端的weblogic服务器上,WebLogic自然是不能处理的,请问 使用反向代理的这个情况 如何配置 js css合并特性?
server {
        listen       80;
        server_name  071099.com www.071099.com;#多个域名用空格隔开
if ($host != "071099.com" ){
 rewrite ^/(.*)$ http://071099.com/$1 permanent;
}
index index.html index.htm index.php;
location / 
{
concat on;
proxy_pass http://upstream;# 反向代理
}
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪静态规则
include /alidata/server/nginx/conf/rewrite/discuz_x2.conf;
log_format  phpwind  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" "$http_x_forwarded_for"';
access_log  /alidata/log/nginx/access/phpwind.log phpwind;
}

举报
zhaiguangtao
发帖于6年前 1回/821阅
顶部