鍍金池/ 問(wèn)答/Java  Linux/ nginx整合tomcat后 有部分tomcat動(dòng)態(tài)請(qǐng)求沒(méi)有經(jīng)過(guò)tomcat 就

nginx整合tomcat后 有部分tomcat動(dòng)態(tài)請(qǐng)求沒(méi)有經(jīng)過(guò)tomcat 就被響應(yīng)了

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location /admin/ {
            root /root/dist;
            index  index.html index.htm;
        try_files $uri $uri/ /admin/index.html;
#        try_files $uri $uri/ /admin/index.html;
        }

        location /api {
            proxy_pass   http://local_tomcat/api;
        }
    location / {
            root /root/dist;
            index  index.html index.htm;
            try_files $uri $uri/ @router;
        }

    location @router{
            rewrite ^.*$ /index.html last;
        }
}

這是配置文件 ,tomcat中找不到接口訪問(wèn)日志. 但是另外一些接口是有日志, 是不是nginx會(huì)緩存tomcat的動(dòng)態(tài)api請(qǐng)求?

回答
編輯回答
怣人

單純看這段配置沒(méi)問(wèn)題
nginx -T的結(jié)果貼上來(lái)吧

2018年6月6日 11:23