我有个问题,可能跟openresty没有关系。我在jsp里面有下面的代码:<% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %>然后所有的路径用的都用basePath去定位。我把这个项目拷贝到tomcat 里面的webapp文件夹下面的abc文件夹。然后再nginx里面设置 server_name www.abc.com proxy_pass http://127.0.0.1:8080/abc; 然后就悲剧了,所有图片,js之类都不能正常显示。我的问题是,在nginx里面,怎么设置ContextPath --
单独在nginx里再配置图片、js的proxy,转到abc目录下。--smallfish http://chenxiaoyu.org 2013/11/7 钱杨 <qian...@gmail.com> 我有个问题,可能跟openresty没有关系。我在jsp里面有下面的代码:<% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %>然后所有的路径用的都用basePath去定位。我把这个项目拷贝到tomcat 里面的webapp文件夹下面的abc文件夹。然后再nginx里面设置 server_name www.abc.com proxy_pass http://127.0.0.1:8080/abc; 然后就悲剧了,所有图片,js之类都不能正常显示。我的问题是,在nginx里面,怎么设置ContextPath -- class="HOEnZb"> --
我有个问题,可能跟openresty没有关系。我在jsp里面有下面的代码:<% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %>然后所有的路径用的都用basePath去定位。我把这个项目拷贝到tomcat 里面的webapp文件夹下面的abc文件夹。然后再nginx里面设置 server_name www.abc.com proxy_pass http://127.0.0.1:8080/abc; 然后就悲剧了,所有图片,js之类都不能正常显示。我的问题是,在nginx里面,怎么设置ContextPath -- class="HOEnZb">