静态文件在/frontend/webman目录
webman应用监听8080端口
域名:webman.v3.com
例如访问:http://webman.v3.com/ 实际访问/frontend/webman/index.html
例如访问:http://webman.v3.com/api/user/info 访问webman应用User控制器的info方法
问题已解决:
我知道原因了,我用的是手册里面的nginx代理示例:
upstream webman {
    server 127.0.0.1:8787;
    keepalive 10240;
}
server {
  server_name webman.v3.com;
  listen 80;
  access_log off;
  location /api/ {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      if (!-f $request_filename){
          proxy_pass http://webman;
      }
  }
    location / {
        root /frontend/webman;
    }
}问题就出在这一句:
proxy_pass http://webman;需要在后面加上斜杠就OK了:
proxy_pass http://webman/;如果不加就会把/api/带上,最终url变成http://127.0.0.1:8787/api/
这样不行,访问http://webman.v3.com/api/返回404,应该是webman不认识/api,要是搞成多应用,估计它就可以识别了,其中一个应用就是api
把它换下位置,我编辑了
一样的,不行
不好意思少打了个反斜杠
一样的,不行。我估计要webman支持才行
目前只找到了一个方法,那就是使用多应用,在app下面增加一个api应用即可
...复制太快了,刚刚

proxy_redirect 那个去掉
你用的是单应用?
是