Nginx反向代理没有将一些页面传递给app服务器

时间:2016-04-26 10:29:44

标签: nginx static reverse-proxy proxypass otrs

我有一台NGINX服务器作为OTRS应用服务器的反向代理运行。

upstream otrs_server {
        server X.X.X.X;
}


server {
        listen 17031;

        access_log /var/log/nginx/otrs.access.log;

        location / {
                include  /etc/nginx/mime.types;
                default_type  application/octet-stream;
                sendfile        on;
                keepalive_timeout  65;
                gzip  on;
                proxy_set_header Host $http_host;
                proxy_pass http://otrs_server;
         }

}

我可以看到OTRS应用服务器的登录页面,当我检查/var/log/nginx/otrs.access.log

时会收到一些页面
 [26/Apr/2016:11:47:56 +0200] "GET /otrs/index.pl HTTP/1.1" 200 3951 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36"

但缺少所有CSS和徽标,我也可以看到/var/log/nginx/error.log

中的错误
2016/04/26 11:47:56 [error] 2353#2353: *279897 open() "/etc/nginx/html/otrs-web/skins/Agent/KIX4OTRS/css-cache/img/logo.png" failed (2: No such file or directory), request: "GET /otrs-web/skins/Agent/KIX4OTRS/css-cache/img/logo.png HTTP/1.1", referrer: "http://X.X.X.X:17031/otrs/index.pl"

对于某些静态页面,nginx使用 / etc / nginx / html / 而不是 http://X.X.X.X:17031

任何人都知道为什么会这样?

0 个答案:

没有答案