
nginx配置图:

server {
listen 8082;
server_name localhost;
location / {
root D:/GXT/gxtWebsite/dist;
index index.html index.htm;
}
location /getNews {
proxy_pass http://172.16.27.67:8080/enterprise/selectAll;
}
location /getProducts {
proxy_pass http://172.16.27.67:8080/enterprise/selectProductSolution;
}
}
另:千万不要在
location /getNews {
proxy_pass http://172.16.27.67:8080
}
这个nginx配置里面直接写域名,至少后面跟一个方法 /selectAll,虽然我不知道为什么,但是直接域名的话好像不行,还是会404,
要这么写
location /getNews {
proxy_pass http://172.16.27.67:8080/enterprise/selectAll;
}