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.7k
1 个回答

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题