这个项目原先是没有前后端分离的,但后来因为某种原因要将它分开,
但在路径请求上出了点小问题。
前提:项目已经发布到tomcat服务器上,要将里面的webpage分离出来作为一个独立的web项目
以下是我的nginx配置
server {
listen 8010;
server_name localhost;
location / {
proxy_pass http://www.***.top:1820;
}
location ^/karen-***/{
proxy_pass http://www.***.top:1820;
}
location ~^([^.]+|.jsp)$ {
proxy_pass http://www.***.top:1820;
}
#设置缓存
location ~\.(html|js|css|png|gif)$ {
root E:/tomcat-8.0.36/webapps/ROOT;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
/karen-**/ :这个是我的项目名
http://www.***.top:1820 这个是tomcat服务器上的网址
完整路径是 http://www.***.top:1820/karen-**/login.jsp;
这样配置好像是不行的,查了很多东西,都是配置那种简单的demo想这种配置完整项目的真找不到,还请各位大佬帮忙!!!