nginx整合tomcat后 有部分tomcat动态请求没有经过tomcat 就被响应了

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中找不到接口访问日志. 但是另外一些接口是有日志, 是不是nginx会缓存tomcat的动态api请求?

阅读 2.8k
1 个回答

单纯看这段配置没问题
nginx -T的结果贴上来吧

推荐问题